Cramping during sleep is usually due to an exaggeration of a normal muscle reflex. When you turn during sleep, you contract your calf muscles and stretch their tendons. This stimulates nerve stretch receptors in the tendon and sends a message back to the spinal cord, telling the calf muscles to contract. Sometimes, the muscles remain contracted and hurt. Painful muscle cramps at night can also be caused by nerve damage such as that caused by pinching a nerve, muscle damage, a partially-obstructed flow of blood to the legs or abnormal mineral or hormone levels. If you have this problem often, check with your doctor. If you do not have a serious cause, you can often prevent night cramps by exhausting the stretch reflex before you go to bed by stretching your calf muscles with wall pushups, and applying a heating pad for 10 minutes before you go to sleep. The most common cause of leg cramps in exercisers is lack of salt.
The Food and Drug Administration has ruled that none of the over-the-counter drugs used to treat night-time leg cramps are recognized as safe or effective. The only drug that has been shown to be effective in treating night-time leg cramps is quinine. Doctors often prescribe 1 or 2 quinine pills at bedtime, but they can cause birth defects and miscarriages, so they should never be taken by a woman who may become pregnant. They can also cause ringing in the ears, headache, nausea, disturbed vision, chest pain and asthma.