A charlie horse..... Large muscles use a lot of energy to do work, and this is supplied by blood. If the supply is not adequate their can be painful spasm; and if metabolites from heavy activity are not removed there can be spasm. Other causes can be a trapped nerve root irritating the muscle. Some people have greater likelihood of spasm due to underlying genetic causes.
Multiple factors: low potassium, low calcium, muscle overuse, trauma, dehydration are common causes. Massage with Bio-Freeze and stretch by pulling toes toward your chest or stand and lift your up using foot and toes (calf stretch), I suggest electrolyte rich drinks (Powerade, Gatorade, Vitamin Water, Pedialyte) and calcium tablets (Caltrate)