My problem may not be the same one you are having, but sure sounds like it to me. My legs and feet would hurt, especially when I sat too long or stood in one place too long, and at night it was like I had restless leg syndrome because I had to keep moving my legs and feet or get up and pace a while to get comfortable. In the end, the veins on my legs and feet started standing out, so I went to the Dr. and he said it is varicose veins. That surprised me because of all that time I went with pain in my legs and feet, but my veins didn't start sticking out until quite a while after all that started.
The doctor said to buy energizing pantyhose. We use to call them support hose. He said to get mild compression, which is 8-15 mm/Hg compression. He told me to buy support hose, not compression hose because if you have the wrong compression, the problem could get worse. I got them at a drugstore, Walgreen's. I put them on when I get up, take them off right before I get in bed, and once in bed, I raise my legs in the air a few seconds so the blood can flow out of my legs. This has really worked for me. I pretty much do whatever I want now with no problem, and the veins haven't gotten any worse. I just wish I had known about wearing support hose before the veins started sticking out because once they are out, there is no going back without taking drastic measures.
If you think it is something serious, of course you should see a doctor, but in the meantime you might want to try support hose because even if you don't have varicose veins, they are good for aching legs and feet.