If you are having trouble sleeping, science has found a much safer solution than sleeping pills. Research suggests those who are physically active a have lower risk of developing insomnia and other sleeping difficulties. The University of Pittsburgh’s Christopher Kline said, “The results show exercise improves both self-reported and objective measures of sleep quality, such as what’s measured in a clinical sleep lab.”

The studies show that exercise is especially good for people with insomnia. Rush University clinical psychologist Kelly Glazer Baron said, “There has been more and more research in the last decade showing exercise can reduce insomnia.” According to the U.S. Centers for Disease Control and Prevention, roughly one of the third of all Americans suffer from insomnia, roughly 108 million people. Nearly 10 percent of the country’s population has chronic insomnia.

Exercise has also been shown to improve sleep apnea. Sleep apnea is a dangerous disorder in which sufferers temporarily stop breathing for up to a minute during the night. Around 18 million Americans struggle with sleep apnea and those with sleep apnea are typically overweight or obese. Kline said, “We did a study where the participants didn’t diet, and exercise alone led to a 25 percent reduction of sleep apnea symptoms over a 12-week period.”

Insomnia, sleep apnea, and other sleep disorders can do more than just leave you groggy in the morning. Disturbed sleep is a key risk factor for conditions such as stroke, heart attack, high blood pressure, diabetes, and obesity. Insufficient sleep is also blamed for many motor accidents that cause injury and death. A new study recently found that sleep deprivation may cause the brain to cannibalize itself.

Many of those having difficulty sleeping rely on medications to make it easier to sleep. Exercise is not quite as effective as sleeping pills, but when gauged against the risk of unwelcome pharmaceutical side effects, exercising is much safer. Sleeping pills can interfere with the breathing of those with asthma or other lung problems, such as emphysema and chronic obstructive pulmonary disease (COPD). The pills also lose their effectiveness in just a few weeks.

The recommended amount of exercise is 2½ hours a week of moderate-intensity aerobic exercise and strength or resistance training that targets every muscle group two days a week. Even people who exercise less than the recommended amount can see moderate benefits. Exercising outside can also be helpful, because bright light can help promote sleep.

Get Analysts' Upgrades and Downgrades Daily - Enter your email address below to receive a concise daily summary of analysts' upgrades, downgrades and new coverage with MarketBeat.com's FREE daily email newsletter.