What can I do if my legs ache/tingle while I sleep?

See a physician.... Restless legs syndrome is often accompanied by tingling and aching of the legs in the evening around bedtime. There is also an association of this syndrome with periodic limb movement disorder that is characterized with repetitive limb movement during sleep. Depending on your symptoms, a sleep study may be recommended.
Possibilities. There are multiple possibilities for aching of the legs when you sleep. One possibility is that you could have restless leg syndrome (pain, discomfort at bedtime) which is relieved with activity/walking. Spinal disease is another common source of nocturnal leg pain/discomfort (ie spinal stenosis, lumbar strain, disk disease, etc).