If your legs hurt, ache, or feel uncomfortable, you may be tempted to chalk it up to aging. But leg pain isn’t inevitable, and often, simple changes can make a big difference.

One common cause of leg pain is statins, drugs used to lower cholesterol. “Ask your doctor—lowering your dose or switching drugs may help,” says Marvin M. Lipman, M.D., Consumer Reports’ chief medical adviser.

Here are three common leg complaints, and how to get relief—before turning to drugs:

Peripheral Artery Disease

Leg pain that starts while you’re walking or climbing stairs could be peripheral artery disease (PAD), a condition that affects one in 20 adults over 50. PAD occurs when arteries outside the heart, most commonly in the leg, become clogged by substances such as fat and cholesterol.

PAD is associated with an elevated risk of heart attack and stroke. Untreated, it can stop circulation in the leg and even lead to amputation.

What to do: Walking can bring on the leg pain of PAD. But prescribed walking—as part of a supervised exercise program designed by your doctor that may be undertaken in a clinic—is actually the best treatment for PAD pain, according to Michael Criqui, M.D., distinguished professor in the division of preventive medicine at the University of California, San Diego School of Medicine.

Walking and other exercise may also help slow the progression of PAD. It's also important to quit smoking and control blood pressure, cholesterol, and diabetes.

Medications for treating PAD, including cilostazol (Pletal and generic) and pentoxifylline (Trental and generic), may only slightly increase your walking distance and can have unpleasant side effects, including diarrhea or vomiting.

Restless Legs Syndrome

An irresistible need to move your legs during inactivity is the key symptom of restless legs syndrome (RLS), which affects an estimated 7 to 10 percent of the U.S. population. Symptoms often worsen with age.

What to do: Suzanne Bertisch, M.D., M.P.H., a sleep physician at Beth Israel Deaconess Medical Center, recommends doing chores at night when you typically have discomfort (RLS symptoms don’t occur while you’re moving), and distracting yourself with video games or knitting.

Moderate, regular exercise can lessen symptoms, while alcohol, caffeine, and nicotine may trigger them. And talk with your doctor about whether you might have an iron deficiency, which may play a role.

For people whose symptoms aren’t helped by lifestyle changes, medications may be an option, though RLS drugs can have serious side effects. Medications such as pramipexole (Mirapex and generic) can backfire and make the condition worse, while pregabalin (Lyrica) may cause weight gain. Your doctor can help you decide whether drugs might be worth trying.

Nocturnal Leg Cramps

These sudden muscle contractions, which often have no apparent cause, can hurt so much that they wake people from sleep. “They can leave a muscle sore for days,” Lipman says. Up to 60 percent of adults report nocturnal leg cramps.

What to do: First, tell your doctor so that he or she can check for underlying causes such as dehydration, nerve disorders, vascular disease, and calcium, magnesium, or potassium deficiencies.

One of the best fixes is stretching: Keep an old tie on your nightstand, and before bed or when a cramp strikes, wrap it over the ball of your foot and keep your leg straight. Holding both ends, gently pull the ball of the foot toward your head.

Quinine (an anti-malaria drug) was once used to treat cramps, but the Food and Drug Administration has warned against that practice due to the potential for severe side effects, such as heart problems.

Editor's Note: This article also appeared in the December 2017 issue of Consumer Reports on Health