Could you be far more specific. Where does the pain occur? Is it above or below the knees? Is it on the outside, inside, back or front of the legs? Does it affect the soles of your feet? Does it feel like itching, tickling, cramping, numbness? Does it feel either hot or cold? Does it occur after exertion? Does hot or cold weather affect it?
The lying down aspect is a clue. Does it feel better or worse when you lie down?