Sleep paralysis. It's commonly caused by waking rapidly from REM sleep, during which your muscles are weakened by the body to prevent you from acting out your dreams. During sleep paralysis one will usually experience extremely powerful hallucinations (often of a bedroom intruder) and/or strange physical phenomena, accompanied by a severe feeling of terror and the sense of a "malevolent force" in the room.
It really is a terrifying experience. About 50% of people will experience sleep paralysis at least once in their lifetime. I've experienced it two or three times, and it hasn't gotten any better.
Again, sleep paralysis is most likely caused by rapid awakening from REM sleep, not by the "spirit world."