Thank you for the information,
There can be a number of causes for pain in the legs, thighs at night.
Dehydration, deficiency of calcium, magnesium, potassium, sodium-electrolytes, vitamins , muscle fatigue etc. can cause it & are frequent factors.
Peripheral artery disease causing circulation abnormalities also can cause pain.
It can also come from pinched nerve at the back.
Systemic diseases like diabetes, low thyroid, or other neurological diseases can cause it.
Sometimes no cause can be apparent too.
When it is continuing, I feel you should have an examination by doctor.
You may try some home measures-
Take plenty of fluid, fruits, vegetables etc.
Electrolyte solution like gatorade can be tried.
Avoid coffee, alcohol, tobacco
Stretching, warm bath can be taken before sleep.
Regular exercise or a walking daily to can be helpful
Vitamin and minerals, calcium supplements can be taken.
I hope this information helps.
I will be happy to assist, if you need any clarification.
Please feel free for any follow up query.