What you are referring to is a neck strain. You can’t move you neck very far, your muscles hurt or are in spasm, and sleeping is often difficult because it’s hard to get in a comfortable position.
Individuals with a neck that is out of position (“misaligned”) will be more susceptible to this. In fact, in our office we recently saw a new patient who told us every two weeks he wakes up with a stiff and sore neck. Now this may be closer to the extreme, but from experience I can tell you that people with misalignments in their neck, whether it’s a shift of one or more vertebrae laterally or a loss in the normal curvature, will be predisposed for the all too common neck strain or “crick in the neck.”
It often happens after sleep, where you wake up and you can hardly move you neck. Usually the strain gets started from a quick turn or movement that spasms or stresses a muscle, and/or shifts a spinal segment. Muscles attach to the vertebrae and if strained or in a state of spasm, will pull a segment or segments out of place. This in turn puts pressure on a nerve or nerves and results in pain.
It works the other way around too. If a segment of the spine puts pressure on a nerve, that nerve cannot communicate adequately to the muscles it innervates. Those muscles then get imbalanced and bind up into trigger points or spasm.