(CNN) If you're one of the third of all Americans who suffer from insomnia -- roughly 108 million of us -- put away your sleeping pills. Science has a much safer solution.

"There has been more and more research in the last decade showing exercise can reduce insomnia," Rush University clinical psychologist Kelly Glazer Baron said. "In one study we did, for example, older women suffering from insomnia said their sleep improved from poor to good when they exercised. They had more energy and were less depressed."

"There are more solid studies recently that looked at people clinically diagnosed with insomnia disorder, rather than self-described poor sleepers," agreed the University of Pittsburgh's Christopher Kline, who studies sleep through the lens of sports medicine. "The results show exercise improves both self-reported and objective measures of sleep quality, such as what's measured in a clinical sleep lab."

Exercise is not quite as effective as sleeping pills, admits Arizona State University sleep researcher Shawn Youngstedt, but if you consider the potential downsides of pharmaceutically induced shuteye, the equation shifts.

"Sleeping pills are extremely hazardous," Youngstedt said. "They are as bad as smoking a pack of cigarettes a day. Not to mention they cause infections, falling and dementia in the elderly, and they lose their effectiveness after a few weeks.

"It's less expensive, healthier and just as easy to exercise," he said, "and there's an added bonus: Research suggests those who are physically active a have lower risk of developing insomnia in the first place."

Helping more than insomnia

There's more good news for the 18 million Americans who struggle with sleep apnea , a dangerous disorder in which you temporarily stop breathing for up to a minute during the night. Exercise can help with that, too.

"For sleep apnea, exercise has always been recommended," Kline said, "mostly to jump-start weight loss from dieting, because those with sleep apnea are normally overweight or obese. But we did a study where the participants didn't diet, and exercise alone led to a 25% reduction of sleep apnea symptoms over a 12-week period."

"Exercise has also been shown to help with restless-leg symptoms across all age groups," Youngstedt said. Restless leg syndrome , a disorder of the nervous system, occurs when the legs -- or other parts of the body like the arms or face -- itch, burn or move involuntarily. The irresistible urge to move often happens at night, which disrupts sleep.

Finding a safe, healthy avenue of treatment for sleep disorders like insomnia, sleep apnea and restless legs is critical, these experts say, because disturbed sleep is a key risk factor for diseases and unhealthy conditions such as stroke, heart attack, high blood pressure, diabetes and obesity.

"There is large amount of literature showing that people who exercise have better sleep," Baron said. "People who exercise reported an increase in deep sleep and a decrease in the number of awakenings. Plus, people felt less depressed, and their mood was better."

Your exercise prescription

How much exercise is needed to get a good night's rest?

Most sleep studies have focused on the recommended amount : 2½ hours a week of moderate-intensity aerobic exercise, along with strength or resistance training that targets every muscle group two days a week.

Kline says "brisk walking, light biking, elliptical machine, anything that increases your heart rate so that you can still talk while exercising but have to catch your breath every few sentences or so, is considered moderate exercise."

"I think trying to do it outside is also helpful, because bright light can help promote sleep," Youngstedt added. "Light exposure helps regulate the body clock."

Other studies show that people who exercise less than the recommended amount, and those who go way beyond in time and intensity, see moderate benefits. It's only when you are training to the level of an elite athlete that exercise can actually interfere with sleep quality.

"High-level athletes, who may overtrain for a certain event, do have issues with sleep when traveling and under stress," Youngstedt said. "But for the vast majority of us, that's not a factor."

What's the best time of day to do this sleep-enhancing movement?

Experts used to say morning was best; in fact, any exercise within six hours of bedtime was strongly discouraged. On that topic, the science has changed.

"One common myth is that exercise should be avoided at night," Youngstedt said. "There are about 10% of us for whom exercise at night does disturb sleep, but I personally think that's because they aren't accustomed to it. For most of us, exercise at night, even if it ends just a couple of hours before bedtime, will help with sleep."

Busting that myth is especially helpful for those who tend to stay up later.

"Night owls have problems getting up in the morning; they just can't do it," Baron said. "Their mood and ability to apply effort just isn't there. If you're sacrificing sleep for exercise, is that a good tradeoff?"

However, one of the benefits of staying with a morning workout, she adds, is that you are less likely to cancel.

Follow CNN Health on Facebook and Twitter See the latest news and share your comments with CNN Health on Facebook and Twitter.

"Morning exercisers are more consistent," she explained. "So many of us have competing demands in our day, so if we leave it to the evening, we might not follow through."

Staying the course is important to keep sleep benefits in place.

"They have to keep it up," Youngstedt said. "I think it helps to have a consistent schedule, so figure out what works best for you and then stick to it."

"If you have insomnia or sleep apnea, it's even more important to exercise," Baron said. "You will likely feel even less inclined to exercise when you're fatigued, but keep with it, because it can really help."