Muscle cramps often occur in the calf or hamstrings muscles and can be a painful way of waking up in the middle of the night.
A recent study in Medicine & Science in Sports & Exercise found that drinking a shot glass (2.5 ounces) of pickle juice stopped exercise induced muscle cramps. It is important to note that this study looked at EXERCISE induced cramps but if you often experience cramps, try drinking some pickle juice before going to bed.
If you do have a cramp, it is best to try and stand on that leg, perhaps on a cold floor or place a ice pack on the muscle to reduce the spasm. Prolonged stretches of the muscle can also be helpful in reducing the duration of the spasm and the frequency of muscle spasms.