system
Given the following post, respond as if you're commenting on Reddit:
human
When I sleep with a bad pillow and spend all of the next day with a crick in my neck what has actually happened to cause such a pain in the neck?
gpt
There are quite a few things that can go wrong.

First, the easiest is that the side opposite the "bend" (i.e. the side that spent the night being stretched) starts to spasm as a result. This will be quite unpleasant, but stretching should help to relieve the problem to a great extent, although it will still be sore. 

Second, the layers of connective tissue (fascia) involved could form adhesions and sort of "glue" things in a painful position. You could also have put prolonged strain on ligaments and tendons from the position of your neck, and they may be inflamed, especially where they attach to muscles and bones. Alternating cold and hot could help.

Third, you could have been in a position to put pressure on a nerve branching out of the foraminal space between cervical vertebrae. Pinching a nerve (radiculopathy) can range from locally painful, to causing pain down your arms, into your chest, down your back, etc. 

You may have some underlying issue, such as spinal stenosis that makes radiculopathy more likely. By the same token, you could have kind of degenerative issue with the discs between vertebrae putting pressure on the nerve, or the bones themselves. You could also have bone spurs, but this is pretty unlikely.