The reason I asked was to see if there was an enlarged lymph node. (swollen gland) Sometimes lymph nodes can just 'pop' up and be quite tender. You would be able to tell even in an area covered by hair by just running your fingers along the area.
If that is not there and there is no rash, then most likely you just strained a muscle. If so, ice will help relieve the pain and over the counter ibuprofen if you are not allergic to it, and it will go away in a few days.
Also, that is near to the area where the sternocleidomastoid inserts according to your description which would make more sense. 'Wry neck' or 'torticollis' can be a complete spasm of this muscle or just localized pain at the insertion of the muscle. It is very common to see this after a person has slept in a nunusually flexed neck position.
Please click accept if you are satisfied.