When you sleep and before you start dreaming your brain shuts off your control of your muscles. It paralises you so that you don't actually run, punch, scream or jump as you would be doing in your dream.
Sometimes you wake up but your brain keeps you paralised. It is a rare phenomenon called sleep paralysis. [link]
The problem is you are not really awake. Your dream still evolves you. You see a dark hand pulling your arm. You hear whispers. Sometimes you feel a heavy body over you. It makes you sweat cold. You try to wake up, try to reach the light or your partner. But you can't.
After I had two consecutive episodes of sleep paralysis my grandmother teached a prayer to make it go away.
"São Mateus me disse que dormisse
e não tivésse medo da onda,
nem da sua má sombra,
nem da unha ratenhada do pesadelo da mão furada"
(Saint Mathews told me to sleep, and not be affraid of the wave or its evil shadow or the rotten nail of the corpse hand)