By Susan Freinke

The latest sleeping pills are safe and effective—but should you even consider taking them? Here’s a quick guide.

Can’t sleep? You’re in good company. Studies suggest that up to 40 percent of Americans suffer insomnia at some point. To get some z’s, those red-eyed legions often spend billions on sleeping pills.

But that doesn’t ensure blissful nights. While the newest meds appear to be safer and more effective than ever, experts say, no pill is right for everyone because each targets the brain’s sleep controls differently. Some pills are best for falling asleep, for instance; others are better for staying asleep. Although getting hooked is unlikely, side effects like daytime drowsiness, dizziness, diarrhea, headache, and even sleep trouble (if you quit taking some pills) aren’t uncommon.

If you’re tempted to try a sleep aid, talk to your doctor to rule out an underlying problem like sleep apnea, restless legs syndrome, or depression. Then discuss what might help, from pills to therapy. Here’s our roundup from experts at Harvard University, New York University, and the University of California, San Francisco, about the benefits of the leading prescription and nonprescription aids—can help get your discussion started:

Ambien CR

Helps you get to sleep within 30 minutes, and, unlike original Ambien, releases a second dose later at night to help you stay asleep; can be used for up to 6 months.

Lunesta

Remains in your system all night to help you stay asleep; can be used for up to 6 months.

Restoril

Works within 30 minutes (so take it just before bed); lasts all night; can help if anxiety is keeping you awake.

Rozerem

Works fast (see Restoril) and clears from your system fast, so it’s good if your only problem is falling asleep.

Sonata

Zips in and out of your system within an hour, so it can help you fall asleep; if you wake again at 2 a.m., you can take another dose.

Melatonin

Usually contains a synthetic form of natural sleep-cycle hormone; useful if your sleep is disrupted by jet lag, according to some studies; available without a prescription.

Tylenol PM

Contains the same antihistamine used in many over-the-counter allergy pills (plus acetaminophen); goes to work in 15 to 30 minutes and lasts all night; available without a prescription.

Valerian

Mild herbal remedy that may help you sleep more soundly, although evidence is scant; available without a prescription.