What exactly is a "crick"? The word is derived from Middle English cricke, crykke - a bend or twist in the neck. Usually, you wake up with your neck either slightly bent to one side or you avoid moving your neck a certain way because of a sharp pain in your neck or shoulder blade - hence why we use the word "crick". The medical term is "torticollis" which means basically the same thing - a bend or twist in the neck.
There are a number of reasons why you can have a crick in the neck or a very stiff and painful neck and some of them are not musculoskeletal such as spinal meningitis. If you have any other symptoms besides a painful and stiff neck, like a fever or a general feeling of sickness, see your doctor.
As for the musculoskeletal causes, you may have simply over stretched the neck muscles, sprained the joint capsule ligament, torn the annular ligament, herniated an intervertebral disc, overloaded the facet joint surfaces or stretched the spinal nerve that exits the vertebral canal. Any of these conditions can create pain and stiffness which is why some clinicians feel that it is impossible to pin down the exact cause of the problem.
So, without a sense of what is causing the problem, an effective solution is sometimes tough to devise. But, there are some things you can do to reduce the symptoms and improve motion.
Avoid stretching your neck. Even though the muscles feel tight, stretching usually does not help and if it does, it's often very transient. Tight muscles get tight mostly in response to another stimulus - inflammation being at the top of the list.
If you must sit, support your head and neck. Some office chairs have a high enough back on them to allow you to rest your head on the chair or even use something like a deflated beach ball behind your head. Doing this allows the tight muscles to relax and lowers the force applied to your disc and joints (and thanks to Lauren Williams - our Director of Operations - for kindly agreeing to be a model for the image).
Try "cervical rock and roll". I explained this here. Gentle oscillations of the joint stimulate anti-pain receptors and other receptors that regulate muscle tension. Cervical rock n' roll relaxes your neck muscles and feels great.
Deep pressure over a tender point in the upper trapezius is sometimes helpful. The upper trapezius muscle, also known as the "coat hanger" muscle usually is very tight and will have a "trigger point" or a spot of extreme tenderness. You'll need a trusted friend to help you with this or see a therapist (massage, physical, kinesio) or chiropractor). To perform the technique, lie down on your back. This helps release the tension in the muscle. Have your friend, using his or her index finger, find the tender spot. You don't have to use much pressure either. Once you find the spot, have your friend gently move your head away from the painful direction while delivering some pressure to the spot. Hold the position until you feel less pain and the spot "gives" or feels as if it melts under your finger. This usually takes 30 to 60 seconds. Now, very slowly, return to a neutral position. Repeat this five times. When you get up from lying down, have your friend hold your head to help you. If you don't do this, the weight of your head will kick off a muscle contraction and the pain will come back (and this technique is rarely curative - it will reduce the pain and improve motion but is often short lived).
Alternate heat or ice on your neck. The choice is yours. Whatever makes your neck feel better - use it. Apply it in a relaxed, comfortable position. Be careful. You'll want to protect your skin by using appropriate amount of toweling. Leave the heat or ice on for 10 minutes and do this at least three times a day.
Use cervical traction. This is a simple and effective technique that can be done at home. You use a special device, an over the door pulley system with attached weights, that is either applied in a sitting position or while lying down. Usually ten minutes a few times a day with 8-10 lbs. of force is enough.
These six things will help you feel better and restore motion however, If you seem to get a crick in your neck often, you may have other biomechanical factors that need attention (a stiff and inflexible thoracic spine is one of them). A therapist with an understanding of spinal biomechanics and tissue healing can help.