The term "charley horse" is of uncertain origin, but the pain associated with one is anything but uncertain. The painful leg cramps, which often wake you in the middle of the night, may be caused by anything from standing too long on concrete to muscular defects or flat feet to dehydration.
If you fall victim to these painful cramps, try walking on the affected leg, then elevating it. Or, slowly stretch your calf muscle by straightening your knee and flexing your foot (this usually works for me). If the pain still doesn't subside, try taking a warm bath or applying ice to the cramped muscles.