Racing of heart, when you suddenly wake from your early sleep is a common phenomenon, but if you feel it every time just on lying down, it is different. it may be due to heightened state of anxiety or may be due to certain drugs, tea coffee etc.
do you feel heart racing at times of exercise or using stairs? or you ever feel dizziness
, loss of consciousness
, chest discomfort
or undue shortness of breath
on exercise. if the answer is no, then probably you need not worry much. Still your complaint requires a physical examination at least by your primary physician. after consulting him please revert back with any queries.