Leg pain is not uncommon in children, especially at night. Parents have for generations been told that these were "growing pains" during to periods of rapid growth but in reality that is probably not likely to be the actual cause. No one is certain why some children go through periods of leg pain and others do not. Massage and warm compresses can sometimes be helpful. If there was leg pain or limping during the day that would definitely be more concerning and should prompt a visit to the pediatrician. If the child is crying, inconsolable, and does not recall the event the next morning that could be "night terrors", which are thought to be related to sleep walking, sometimes waking the child briefly before you go to bed can help change their sleep-wake cycle and stop the "night terrors" from happening. With time, regardless of whether they are growing pains or night terrors these crying spells usually resolve so patience might be the only effective treatment.