In the night time when one moves muscles or stretch them; there is an excessive contraction of the muscles (thus the rock hard feeling) and pain. An excessive and persistent contraction of muscles fibers and delayed relaxation of the muscles is called cramp. Neuropathy and circulation issues can be responsible for it. Take Calcium and vitamin D with a supplement of magnesium and zinc a day, for the prevention of recurrence. Gatorade, can help as it contain electrolytes. Do follow up with your doctor for a blood test to check the electrolytes.
Do the following measures so it is arrested immediately, if this recurs;
1) Straighten the leg, flex the foot upward toward the knee, or grab the toes and pull them toward the knee.
2) Walking or shaking the affected leg, then elevating it, may also help.
The exact cause of cramps is not well understood, but there are some risk factors that are thought to contribute to this condition:
1) Muscle fatigue,
2) Heavy exercising,
4) Over weight
5) Electrolyte imbalances,
6) Vitamin deficiency,
7) Age above 60.
The medical causes related to the disease process are;
1) Calcium and phosphorus imbalances can cause cramping.
2) Low potassium or sodium (salt) levels.
3) Deficiencies of a nutrient called hesperidin, an antioxidant flavonoid found in oranges and other citrus fruits, have also been linked to nocturnal leg cramps.
4) Overexertion, standing on concrete for long periods, or prolonged sitting (especially with the legs contorted) may contribute to nighttime cramps.
5) Having structural disorders in the legs or feet (such as flat feet) may increase the risk for cramps.
6) Among the many medical causes of muscle cramping include hypothyroidism, Addison's disease, uremia, hypoglycemia, anemia, and certain medications.
Please feel free for your follow up questions.
I would be happy to assist you further, if you need any more information.