It's probably synaptic firing (I know that happens when you pass out, but I'm not sure about dreaming)