I have had this happen to me too often, and it used to terrify me. I felt as if someone was in my bedroom holding me down and preventing me from screaming for help.
This changed one night after I read a wonderful book called Psychic Dream Walking. It explains this happening. The author explains that it has been said when you awaken suddenly, this means that you have awaken prematurely. When you sleep your body does become paralyzed, but when you wake up suddenly, sometimes your body is still in that paralyzed state and you are not quite asleep nor quite awake.
When this happened to me the other night, I had become aware of this and was able to pull myself out of the paralysis quickly and safely without any panic. This was my first success with this, so I do not know how I was able to do this.