A device like a headband that aims at preventing migraine headaches has been approved by the Food and Drug Administration, but how does it work?

The device, called Cefaly, was approved yesterday (March 11) as an alternative to pain medication for prevention of migraines, according to the FDA. It's worn across the forehead and ears.

Cefaly uses an electric current to stimulate the trigeminal nerve, a nerve that carries information about sensations in the face to the brainstem, and has been linked with migraine headaches. [Ouch: 10 Odd Causes of Headaches]

This method of using electricity for pain relief is known as transcutaneous electrical nerve stimulation (TENS), and is sometimes used to treat pain in a specific body region, such as back pain or joint pain. The therapy has even been used by some to treat labor pain, pain from injuries and cancer pain, according to the American Cancer Society.

The treatment is hypothesized to work in two ways: the electrical pulses may interfere with pain signals to the brain, or they may stimulate the body to produce more endorphins, which are natural painkillers, according to the ACS. It is not thought to cure the underlying causes of pain.

Although there is some evidence that such nerve stimulation treatments may provide short-term pain relief, the long-term benefits haven't been proven, the ACS says.

The FDA approval of Cefaly is based in part on a small study of 67 people in Belgium who experienced frequent migraines (at least two per month) and did not use pain medication. Those who used the device had fewer migraines per month than those who used a placebo, the FDA said. But the device did not prevent migraines altogether, and when the headaches did occur, they were just as intense as before treatment.

Another study found that slightly more than half (53 percent) of people who used the device in a trial said they were satisfied with it and would buy it.

Cefaly should be used only once per day for 20 minutes, and patients may feel tingling sensations where they place the device, the FDA says. Some people in the studies said they disliked the feeling of using the device, and some had headaches after treatment.

The device may also cause redness of the skin around the area of the electrode, and should not be used if you've had brain or facial trauma or have abrasions on the forehead, the company says.

The ACS says that TENS should not be used in people with heart problems, and that people with pacemakers, defibrillators and infusion pumps should avoid exposure to electric current.

Follow Rachael Rettner @RachaelRettner. Follow Live Science @livescience, Facebook & Google+. Original article on Live Science.