The average person experiences pain from a stiff neck every once in a while - this is perfectly normal. The most common kind of pain due to a stiff neck is when a person moves his head from one side to the other and experiences a sharp pain. The physiological explanation for a stiff neck is that the muscle called levator scapula, which connects the neck and the shoulder, gets strained.
Oftentimes, a stiff neck arises from staying in an awkward position for an extended period of time. For example, if you sleep on your side with a pillow that is too high, you can wake up with a stiff neck. Another example would be when you hold the phone between your ear and your shoulder by tilting your head. Doing this for a long time will almost always result in a stiff neck.
For mild cases, a hot compress can remove the pain from the stiff neck. A hot shower or bath will do the same thing as the heat relaxes the muscle. Additionally, you can gently massage the affected area. If you can find someone to do the massage for you, the results will be more optimal.
If the pain does not go away fast enough for you and it interferes with your routine, you can take medication. Aspirin, ibuprofen, and other over-the-counter medicine will work quite quickly to ease the pain, as well as take the swelling down.
As with may things, prevention is much better than the cure. If you experience pain from a stiff neck quite regularly, you might want to determine the cause and avoid those activities.