My husband who is 56 keeps getting severly painful cramps mostly in his thighs and sometimes his calfs. What could be the cause of that?

Many . Can be many things from electrolyte disturbances, magnesium deficiency, potassium deficiency, vascular compromise or even nerve impingement in back. Dehydration is usually the common cause. Try hydration and if not better see physician to check out these other possibilities.
Muscle cramps. Muscle cramps in the calf and thigh are common, and often there is no evident cause. They occur more commonly with advancing age. Occasionally, they can be caused by other conditions, such as diabetes, electrolyte imbalance (eg, from kidney disorder, or from taking a diuretic water pill, or from low calcium level) or other metabolic conditions. Your doctor can evaluate you for any of these causes.