I hear it often: A friend swears that her running practice staves off bouts of low spirits. Another says going to the gym before work keeps him mentally steady.

Perhaps you’ve heard similar stories; perhaps you believe it for yourself.

Those anecdotes prompt some questions. Is there evidence to support the idea that exercise can have an effect on depression? And if so, how much exercise? A number of research studies have been done to answer those questions and others.

One study assigned participants, 202 depressed adults at least 40 years old, to one of four groups. One group attended supervised group exercise sessions three times per week, where they monitored their heart rate as they walked or jogged on a treadmill for 30 minutes. A second group received similar instructions but were left to work out on their own at home. Groups three and four took pills: either the antidepressant medication sertraline or a placebo.

After 16 weeks, researchers rescreened participants for depression and found 45 percent of the people in the supervised exercise group no longer met the criteria for major depression. In the other groups, 40 percent of home exercisers, 47 percent of medicine takers and 31 percent of placebo pill takers were no longer depressed.

That’s right, the supervised exercisers did as well as the people who took an antidepressant. As promising as these results were, however, it was a small study.

James Blumenthal, a psychologist at Duke University who co-wrote the paper, says there are a number of studies that, like his, support the idea that exercise might be helpful in treating depression. Like his, most of the studies are small. “There are no large, multicenter clinical trials,” he says, which are typical for drug studies funded by pharmaceutical companies.

There are also issues with the design of experiments, says Chad Rethorst, a researcher at the University of Texas Southwestern Medical Center. “What is the comparison control condition?” A placebo pill prevents people from knowing if they’re getting medicine or not; it’s hard to come up with a placebo situation for exercise.

Still, a number of scientists have combined results from the many small studies to see if an overall effect can be described. These review papers generally find a small to moderate effect of exercise in the research studies. How does that evidence translate to the real world?

“Any treatment for depression works for some people, but not for everybody,” Blumenthal says. That’s true for medication, talk therapy and exercise alike.

Depressed patients, by the nature of their condition, are not motivated, Rethorst says, so engaging in a new and challenging activity can be tricky.

Mental health practitioners probably will mention exercise, along with other healthy behaviors such as sleep, to their patients, even as they prescribe talk therapy or medication as the main treatments. But it’s not clear how many psychologists or psychiatrists actually prescribe exercise as a treatment.

Some practitioners do advocate exercise.

Antonia Baum, a psychiatrist in private practice in Bethesda, says, “I always take an exercise history with my patients.” As for starting and sticking with an exercise program, she’ll talk through the basics and help people find an activity that they’ll enjoy.

“You need to find a way that’s sustainable,” she says.

A 2015 survey suggested that a majority of depressed patients would be interested to try “an exercise program designed to improve mood.”

Rethorst reviewed the studies to come up with guidance for providers on how to prescribe exercise, including what kinds of exercise, frequency, intensity, duration, and how to help people stick to a program.

How much exercise? The research studies suggest that at least 150 minutes of aerobic activity — walking, jogging or biking — per week is good. Conveniently, that’s in line with public health guidelines from the Centers for Disease Control and Prevention.

A few studies have found positive effects with resistance training or weight-based exercise, but there’s more evidence for aerobic activity.

For people who may want to try exercise as a treatment for low mood or depression, Rethorst says it’s still wise to seek a practitioner’s help.

“The optimal clinical practice will include regular monitoring of symptoms, as with the initiation of any treatment plan,” he says. Worsening of symptoms might prompt different or additional treatments.

In other words, don’t undertake exercise-as-treatment on your own. If you’re really depressed, you need treatment and oversight. For instance, exercise doesn’t always work. You may put yourself at risk of not having other treatments at the ready if you’re not seeing a provider of some kind.

Also, maintaining an exercise program is not easy — it’s time-consuming and it’s common to lose motivation at some point. Getting social support by joining a group or class of some kind can help. Baum says she sees her patients regularly enough, often weekly, that she can check in and encourage people to stick with it.

Blumenthal says he sees good adherence to exercise by the participants in his studies. But, he adds, “We do lots of monitoring. The accountability aspect may be critical.”

You may need patience. “The benefits occur within six to eight weeks — not right away,” Blumenthal says. “Meds work a little more quickly.”

And, of course, exercise is good for many other aspects of your health. “I believe in exercise personally and in my practice,” Baum says. “I endorse its beneficial efforts.”

Ketamine, a new antidepressant, has been blowing minds for decades

Can certain foods help with anxiety and depression?

Exercise can help treat mood disorders