I too had this pain, I had a weight over my head working on my tris and I felt this sudden shooting pain from my back neck around the left side of my head, It was VERY painful for the first 2 minutes, I just layed down tensed, I could barely open my eyes and when I did my vision was out of focus, and for hours after that there was a throbbing non stop. I had the pain when ever I would get up and move around for some time. Anyways mine was pretty serious, but if its not to painful I wouldnt worry to much. Like they said, a pinched muscle, or then I was told it could be you ruptured something.
You might have pinched a nerve from bad posture while straining your neck muscles. This happens to me occasionally. I would say dont worry about it unless the pain persists and it causes you agony or sleeplessness. In the meantime, avoid strenuous activity for a few days. Good luck.