This could be a few things. Leg cramps - some very painful - can be caused by several B vitamin deficiencies, so I would start by adding a multi-vitamin to your regimen. Especially as we age but also under stress or medication, our bodies process vitamins less efficiently, so the vitamins you get from your diet may still need some supplementation.
Second thought would be that this is Sciatica and your condition is caused by a pinched nerve in the lower back - it manifests as a pain in your thigh, but the nerve is being squeezed higher up. If vitamins do not help, try to use better lower back support when sitting and see a chiropractor for a few mild adjustments to the lower back and see if this helps - Sciatica is often felt towards the back of the thigh and can be very painful.
If neither of those treatments proves effective, I would consult a circulation specialist to see if you have arterial problems in that area. A mild thickening of the artery wall in that area could cause some similar symptoms.
