Anyone with a TV has likely seen the Lunesta moth, fluttering from house to house, bringing sleep to restless insomniacs; or observed that rooster, strutting dark streets alone after being banished from bedrooms by Ambien CR; or watched Abe Lincoln beckon a guy back to Dreamland, thanks to Rozerem. Indeed, ads for anti-insomnia drugs are ubiquitous. Makers of those three medications alone spent just shy of $300 million last year to publicize their products on TV, radio, the Web, and in print, according to TNS Media Intelligence, a company that tracks advertising. What consumers don't see marketed is an insomnia treatment that evidence suggests is equally if not more effective: cognitive behavioral therapy, or CBT.

Cognitive behavioral therapy has been applied to everything from depression and anxiety to chronic pain and addiction. But a brand specifically fashioned for insomniacs has been gaining ground. Seventy to 80 percent of people with chronic insomnia—persistent difficulty in falling or staying asleep—seem to benefit significantly from a treatment course of CBT, experts say. And the gains have been shown to last for years after sessions end. Prescription sleep aids can help summon sleep in the short term, but once people stop taking the medication, they tend to backslide.

Medication "is more like a Band-Aid," says Charles Morin, a professor of psychology who directs the sleep research center at Laval University in Quebec. "It doesn't address those factors that perpetuate and maintain insomnia." CBT, he says, does. That's because for many people, chronic insomnia is at least in part a problem of distorted thoughts and behaviors that impinge on sleep. CBT aims to fix those.

The cognitive component of the therapy helps alter unhelpful attitudes and beliefs thatcause anxiety, arouse the body, and make sleep difficult. Consider someone who tends to catastrophize: If I sleep poorly tonight, I won't be able to perform at work; If I can't perform at work, my boss will notice; If my boss notices, I won't get that raise; If I don't get that raise, I'll lose my home. A therapist might help him search his history for times when he slept poorly but still did well the next day and vice versa, then help him restructure his thoughts, á la: If I don't sleep well tonight, I won't be at my best tomorrow, but I'll still make it through and perform adequately. A therapist might also help dispel myths about sleep, such as the belief that everyone needs eight hours for optimal health and functioning—not true—or help people schedule problem-solving times during the day, so as not to bring worries to bed.

The behavioral piece helps reset the sleep-wake cycle, which can get thrown off by reactions to insomnia. Some of this process is straightforward: avoiding daytime naps, rising at the same time daily, getting out of bed when sleep isn't happening rather than agonizing with eyes glued to the clock. Some steps are more complex. "Sleep restriction," for example, is a technique that limits time in bed to help people boost their "sleep efficiency," the percentage of time in bed that they spend asleep. For example, an insomniac who averages six hours of slumber each night—regardless of whether an additional three are spent trying to doze off—would start by restricting time in bed to no more than six and a half hours. Presumably, he'd clock less sleep than that, be tired, and have less trouble sleeping the next night.

CBT is no quick fix: People typically need between two and eight sessions to reap benefits, and it takes effort to implement a therapist's advice. But "there's general consensus now," says Gregg Jacobs, an insomnia specialist at the University of Massachusetts Medical School's Sleep Disorders Center, that CBT "is the preferred and recommended first-line treatment" for chronic insomnia. It empowers patients to regain control over their sleep, and once habits are changed, they become a way of life, he says.

There's just one big problem: Not everyone has access to CBT, given a severe shortage of practitioners trained to offer CBT for insomnia, experts say. Only about 130 people in the United States have so far been certified by the American Academy of Sleep Medicine (AASM) in behavioral sleep medicine. While they're not the only ones equipped to offer CBT for insomnia—about 1,800 AASM accredited sleep centers in the country either offer CBT for insomnia or should be able to direct sufferers to someone who does—that small cadre of specialists speaks to the shortfall. "The dissemination of this treatment remains a challenge for us," says Jack Edinger, a clinical professor in Duke University's psychiatry and behavioral sciences department. It's especially difficult, he says, for people in rural areas to find practitioners trained in CBT for insomnia.

That's where the Internet comes in. Data from two recent small studies—one described in the Archives of General Psychiatry, another in the journal Sleep—suggest that interactive Web-based programs, based on the components of face-to-face CBT therapy, can help people improve their sleep. The lead authors of both studies say they plan to make their programs commercially available in the future. Jacobs already runs a program called Conquering Insomnia, which "replicates" a CBT treatment program he developed and tested in roughly 10,000 patients (www.cbtforinsomnia.com, $24.95). HealthMedia's Overcoming Insomnia is available at no cost through many employers and health plans such as Kaiser Permanente and Aetna, according to a company spokesperson, and it's also being tested for sale to consumers (healthcoach.myselfhelp.com, $19.95).

Internet-based treatments "have tremendous capacity for reaching a very large number of patients," says Michael Sateia, a professor of psychiatry and chief of sleep medicine at Dartmouth-Hitchcock Medical Center. But Sateia, who wasn't involved in the latest studies, cautions that more research is needed to evaluate the treatments' effectiveness. Same goes for the CBT-for-insomnia self-help books that are multiplying, experts say. It's not clear which insomniacs would benefit most from self-help measures and which need face-time with a therapist; insomnia can be the byproduct of a physical or mental health problem, experts say. "We have to be careful," says Morin. "Not everyone will do well with reading a book or [using] the Internet."