1. Enlightened, “Lonely Ghosts” (2011)It’s rare to come across a TV dream sequence that seems legitimately dreamlike. The average trip into a television character’s subconscious is conducted with too heavy a hand: The symbolism is ladled on, perhaps, or the dream is used as an excuse to stage a fantastical and/or phantasmagorical series of events that can be wiped away with the simple declaration, “It was all a dream.” (See: Punky Brewster’s “The Perils Of Punky.” Or don’t, if you’re not into having your own legitimate nightmares.) But the Mike White-Laura Dern collaboration Enlightened does nothing without a light touch, including the low-key—and therefore stunningly authentic—dream that opens the season-one episode “Lonely Ghosts.” Cutting back and forth from the POV of Dern’s character, rageaholic-turned-do-gooder Amy Jellicoe, director Jonathan Demme pushes through a party that spills across the landscape of Amy’s life, filling her mother’s home and her workplace with hypnotic, Enter The Void-like pulses of light. It’s a simple alteration, but it fundamentally transforms the two most familiar spaces in the show’s universe, all the while mirroring a rowdy night out Amy has at the end of the episode. There’s a modicum of foreshadowing in the “Lonely Ghosts” dream, but it’s more about replicating the off-kilter sensation of piecing together a dream after the fact, revealing the alien within the mundane, and reaching out to grab something you can never touch.

2. Twin Peaks, “Zen, Or The Skill To Catch A Killer” (1990)David Lynch and Mark Frost spread an illusory atmosphere across Twin Peaks’ 30 episodes, so it took a lot to differentiate between the waking life of FBI Special Agent Dale Cooper (Kyle MacLachlan) and the REM visions that eventually led him to Laura Palmer’s killer. In this case, “a lot” is one of the most iconic dream sequences in television history: Footage of MacLachlan tossing and turning in a hotel bed is intercut with the first hints of the series’ singular, backwoods mythology. Then Michael J. Anderson moves things forward while speaking backward, and then Laura Palmer (Sheryl Lee) herself shows up—or at least she feels like she knows Laura Palmer. (But sometimes her arms bend back, so… maybe she doesn’t?) Cooper’s first visit to the Red Room takes masterful approach to uncovering a mystery by burying it in red herrings, boasting dialogue that would be obtuse even if Anderson and Lee’s lines weren’t played in reverse. It’s all appropriately nightmarish, and ultimately obeys the No. 1 rule of real-life dreams: The only character who’s interested in it is Cooper, though that interest pays off—even when it comes to that odd bit about the out-of-style gum.

3. Carnivàle, “After The Ball Is Over” (2003)Carnivàle was positively packed with meaningful dream sequences, all of which aimed to lay out the series’ occasionally labyrinthine mythology. But the best of these sequences came in the series’ second episode, the dense, mystifying, ultimately satisfying “After The Ball Is Over,” which did a better job of laying out the series’ stakes than the pilot did. Twin Avatars Justin Crowe (dark) and Ben Hawkins (light) wander into a diner. They sit forward, facing a mirror, saying nothing, watching as their predecessors, Henry Scudder (dark) and Lucius Belyakov (light), enter, sitting in a table behind them. When viewed head-on, dark sits in front of dark and light in front of light. But in the mirror, Ben sits in front of his father (Scudder), while Justin sits in front of his (Belyakov). Then the two men in the background clink wine glasses and the place explodes. It’s at once mysterious and an elegant way to lay out the backstory the series would spend its mere two seasons exploring.

4. The Dick Van Dyke Show, “It May Look Like A Walnut” (1963)There are few storytelling devices more disappointing than, “It was all a dream!” which might work once on an impressionable young reader or viewer but will rarely work a second time. It’s usually just an excuse for a particular story to indulge in some sort of terror or whimsy without straining the credulity of “reality.” But “It was all a dream!” can work if the particular story is sending the whole enterprise up, and that’s what The Dick Van DykeShow does so memorably in “It May Look Like A Walnut.” Rob Petrie (Van Dyke) goes to bed after watching a science-fiction movie, which causes him to believe an alien who looks like Danny Thomas is coming to take over the planet—and remove Rob’s sense of humor and thumbs. The whole thing revolves around walnuts, and it culminates in one of the most famous shots in all of television, as Rob opens a closet in his living room to reveal a flood of walnuts—and his alien-occupied wife, Laura (now Lolak, still played by Mary Tyler Moore), riding down said flood to greet him.

5. The Cosby Show, “The Day The Spores Landed” / “Cliff’s Nightmare” (1989, 1990)Sometimes dream sequences play a small part in a larger mythology; sometimes they serve the more modest task of curbing a character’s voracious appetite. In a pair of half-hours from The Cosby Show’s sixth season, Cliff Huxtable (Bill Cosby) learns the hard way that a sausage hero is not an appropriate bedtime snack—after he dreams about giving birth to a much longer sub (and a liter of orange soda) in the climax of “The Day The Spores Landed.” That indelible image makes for a suitably bizarre payoff to the episode’s straightforward pregnancy allegory. The scrambled dream logic is saved for the Muppet-bolstered episode “Cliff’s Nightmare.” Despite the admonishment of his wife, Dr. Huxtable wolfs down another artery-clogger and ends up flitting through a fun-house version of the family’s Brooklyn Heights brownstone, before being whisked away to a hospital staffed by the cast of the short-lived Jim Henson Hour. Both episodes demonstrate that if a show’s going to go wacky with a dream episode, it should go wacky—though it’s difficult to ascertain how hanging out with Muppets constitutes a nightmare.

6. The X-Files, “Paper Hearts” (1996)The dream sequences in the X-Files episode “Paper Hearts” are meant to stand in for the show’s usual paranormal beasties, since the episode involves Mulder (David Duchovny) and Scully (Gillian Anderson) chasing a very real—and all the scarier for it—child predator who kidnaps and kills children, then cuts hearts from their pajamas. In his dreams, Mulder, who worked the case before catching the killer, has a vision that leads him to the body of one previously unfound child. He begins to think that perhaps the criminal was also responsible for the abduction of his sister, Samantha, the event that set him on his alien-foiling quest. The episode proves inconclusive on that point, but it’s haunting anyway. Mulder’s dreams, as scripted by a young Vince Gilligan, suggest how this methodical man might puzzle over cold cases in his subconscious: laser pointers dancing along walls, pointing out bits of evidence his conscious brain missed all those many years ago.

7. The Sopranos, “The Test Dream” (2004)No drama series did more with dreams than The Sopranos. Since it’s a series at least partially about the psychotherapy process, that makes sense. But perhaps the series’ crowning achievement in this regard is season five’s “The Test Dream,” which features a dream lasting nearly a third of the episode, a peek into Tony Soprano’s subconscious that allows him to piece together his cousin’s guilt in a murder, confront the specter of his dead mother, and realize once more just how hunted and how blessed he feels. The episode’s pinnacle, however, depicts a kind of dream that’s rarely shown on television: the kind where the dreamer finds himself in a place that was once well-known but has now taken on an air of menace. Tony returns to the school gym where he once contemplated becoming a high-school coach instead of a mobster, to hear the voice of his old mentor first berating him, then asking why he never stuck with trying to be a coach. Tony abandoned that dream, so the whole sequence becomes deeply haunting. It becomes even more so when he calls his estranged wife and she asks if he’s been having that dream again. This decision has haunted Tony his whole life, and will haunt him to his grave.

8. Mad Men, “Mystery Date” (2012)Unsurprisingly, since it’s a show created by a Sopranos alum, Mad Men frequently experiments with symbolic dreams and fantasy sequences—none more disturbing or creepily realistic than Don Draper’s dream of an encounter with old flame Andrea (Mädchen Amick) in season five’s “Mystery Date.” The whole thing is ambiguous enough that there’s some debate over how much of it is real, to the extent that when Andrea approaches a sleeping Don (Jon Hamm) and seduces him, only later to be strangled by him, the audience might still be worrying that it’s all really happening. But the use of reversed footage (Don leaves the bed, and when he gets back in it, it’s just the same shot played backwards) suggests that the whole thing is a figment of his feverish brain, inspired by the Richard Speck murders discussed earlier in the episode.

9. Battlestar Galactica, “Crossroads” (2007)In the world of Battlestar Galactica, the line between “dream” and “prophetic vision” is slim, but if a character is having one of these vision-dreams, chances are good it’s taking place in the golden-hued environs of the Opera House on the planet Kobol. Originally seen in the first-season episode “Kobol’s Last Gleaming” and popping up here and there all the way through to the series finale, the Opera House plays a key part in the third-season two-part finale, “Crossroads,” when it serves as the setting for a series of shared dreams centering on the human-Cylon offspring Hera. Shown in flashing glimpses and always just out of reach, the tiny Hera is pursued by her Cylon mother Sharon Agathon (Grace Park) and President Laura Roslin (Mary McDonnell), who’s in the midst of a fever dream brought on by her cancer treatment. Both women awake screaming at the same moment, as Hera is scooped up by the waiting Number Six (Tricia Helfer), who’s experiencing the same dream while locked in the Galactica’s brig. Later, Six returns to the Opera House in another dream, where she, Gaius Baltar (James Callis), and Hera look upon five glowing, robed figures. These figures will turn out to be the Final Five, the complicated concept that drives BSG’s concluding seasons, but their initial appearance in “Crossroads” is suitably dreamlike: confounding, abstruse, and just a little terrifying.

10. Buffy The Vampire Slayer, “Restless” (2000)“Restless,” the fourth-season finale of Buffy The Vampire Slayer, features four dream sequences, in which each of the main characters is stalked, Freddy Krueger-style, by “the first slayer.” This device allows for a lot of surreal images and moments of weird comedy, as well as a hard-to-resist opportunity to have Anthony Stewart Head break into song. But there are also some striking, unsettling touches that have the indefinable power and strangeness of a real dream, such as the shot of Xander looking miserable in over-bright sunshine as he watches himself working out of a food cart—all the while insisting that he doesn’t feel as if his friends are leaving him behind—and the sudden cuts to a wide shot, with the sound dropping out, during the climactic fight.

11. NYPD Blue, “I Have A Dream” (1999)Introduced as a racist, bullying drunk, NYPD Blue’s Andy Sipowicz (Dennis Franz) mellowed over the years, and by the time of the sixth-season episode “I Have A Dream,” he’d become enough of a good person to start having nightmares about it. In the episode’s opening recurring-dream sequence, Sipowicz, as a terrified child, sits in a corner while his maimed father towers over him, berating him for being too reasonable toward a troubled black colleague. Doesn’t he know that “they” cost him his job—and his eye? As written, the scene is heavy-handed and psychologically facile. As staged and acted, it’s disturbingly freaky, not the least because both the young Andy and his monstrous father are played by Dennis Franz—who, clean-shaven and carefully lit to play the father, doesn’t really look like himself. His voice, however, is impossible to mistake for anyone else’s, especially at full bellow.

12. M*A*S*H, “Dreams” (1980)The symbolism in the nightmares seen in the season-eight M*A*S*H episode “Dreams” is heavy-handed and obvious, getting into exactly what each character longs for or fears. But the execution is haunting, and unusually accurate about how nightmares feel to the people caught up in them. Director Alan Alda left out the usual laugh track, and in many cases the background music, leaving the cast caught in hushed, breathless situations full of creepy dream-logic and constantly changing situations: A crucifix becomes a crucified soldier, a ballroom opens up into a surgical theater, a marriage bed is placed in the middle of a field and then filled with bloody, wounded soldiers, and so forth. In the episode’s final, most disturbing dream, Alda himself, as Hawkeye Pierce, admits during a medical course that he hasn’t studied for the exam and doesn’t know how to reattach a soldier’s severed limb, so the teacher has him remove his own arms. Then he’s suddenly sailing down a black river filled with floating detached limbs, and facing a new influx of wounded soldiers, while realizing that without arms, he can’t operate to save their lives. In the later seasons, M*A*S*H often went from comic to bitterly tragicomic, but there’s nothing funny about this episode, which communicates the sheer horror that even the most unlikely and implausible scenario can instill in someone experiencing a nightmare.

13. The Kids In The Hall, season one, episode one (1989)“I had the pear dream again,” Scott Thompson gasps at the top of a sketch during the first episode of TheKids In The Hall. He’s just woken up from a soft-focus nightmare where he slices and eats a pear with orgasmic rapture. Then he wakes up over and over, in bed with a new person each time, repeatedly bringing up “the pear dream,” until he finally wakes up alone in bed with a pear. It’s a ridiculous scenario, played with mock-art-film pretension and sniggering humor, but the scene does evoke that awful sense of waking up over and over within a dream and never fully knowing what’s real—not to mention the heaviness, significance, and danger that an entirely mundane object can take on in sleep.

14. The Twilight Zone, “Shadow Play” (1961)Nightmares are bad enough for the sleeper, but it would be a special kind of hell to be stuck in someone else’s bad dream. That’s the premise for the second-season Twilight Zone episode “Shadow Play.” Dennis Weaver stars as a man convicted of a capital crime and sentenced to death; but as he tells it, the case, the jail, the whole world is all in his mind, and will last only up until the moment of his execution. Every night, he has this dream, and every night it’s always the same. It’s an unsettling idea, and Weaver’s half-crazed pleas sell his desperation well, but things get really interesting when other characters in the story—a lawyer, a reporter—start to suspect he’s right. Without showing Weaver’s waking life, or explaining just how self-aware these phantasms are, the episode manages to capture that awful feeling of knowing doom is coming, but being unable to do anything about it. It’s eerie, strange, and hauntingly inevitable.

15. The Prisoner, “A. B. And C.” (1967)In the Village, nothing is safe; not even dreams. Number Six (Patrick McGoohan) realizes this firsthand in “A. B. And C.” when Village boss Number Two (Colin Gordon) decides the only way to get the information his bosses want out of Number Six’s head is by messing with his mind while he sleeps. Through a combination of drugs, mind control, and psychic surveillance, Number Two and his lab team force the eponymous prisoner through three different dream versions of the same party, using familiar faces from the protagonist’s life before he was captured to trick him into confessing his secrets. As the dreams go on, the stress on Number Six’s mind increases, and the filming becomes appropriately surreal, full of twisted angles and sudden shifts. When Number Six finally realizes what’s happening to him, he takes control and creates a trap to remind his captors for the umpteenth time just how hard he’ll be to break. Many shows employ dream sequences; few use them with The Prisoner’s devilish cleverness.

16. Six Feet Under, “Ecotone” (2005)Throughout its run, Six Feet Under blurred the line between dream and reality with its extended fantasy sequences and ghostly visitations. The show’s dream sequences were usually authentic, though few were as powerful as the final scene of season five’s “Ecotone.” After Nate Fisher (Peter Krause) has a stroke, his brother David (Michael C. Hall) waits at his bedside. Falling asleep, Nate dreams he’s back at home, late for an outing to the beach with David (now sporting a goatee and a pot addiction) and his long-deceased father. Nate immediately assumes the David in front of him is the “real” one, and the buttoned-up brother he knows in the waking world isn’t. By the time they hit the beach and Nate jumps into the water, David has transformed back into his typical self. The focus of the dream then switches to David as he watches his brother swim. When his father offers him some crack to smoke (an allusion to an earlier traumatic experience), David wakes up to find that Nate has died. Nate going off into the water is a facile metaphor for his death, but the shifting protagonist, the influx of memory, and David’s multiple identities make the scene authentic, even with its obvious symbolism.

17. The New Batman Adventures, “Over The Edge” (1998)After the death of his daughter at the hands of the Scarecrow, Commissioner Gordon becomes a man fixated on revenge, targeting Batman for keeping Barbara’s secret Batgirl identity from him. Paul Dini’s script for “Over The Edge” is one of the darkest episodes of The New Batman Adventures, tapping into the adult themes that were commonplace in the show’s former incarnation as Batman: The Animated Series. Beginning with Gordon and the Gotham City police opening fire on the Dynamic Duo in the Batcave and ending with both the Dark Knight and the commissioner getting knocked off a rooftop by Bane, “Over The Edge” is a chilling potential end for the hero that explores his complicated relationship with the head of Gotham’s police force. Turns out it’s all a dream caused by Barbara’s exposure to the Scarecrow’s fear gas—which doesn’t feel like a cop-out because the dream is a setup for the episode’s final scene: a tender moment between Barbara and her father where he tells her that he can’t acknowledge her costumed extracurricular activity because of his job, but that he’s still proud. Barbara’s nightmare forces her to have a conversation that’s a long time coming, and the reality is much more comforting than her horrific fantasy.

18. The Young Ones, “Time” (1984)Not every dream sequence can be immediately identified as such, but when a sitcom that’s normally a multi-camera affair kicks off an episode using the single-camera format—as The Young Ones did with the fourth episode of the show’s second series—it’s a clear tip-off that something’s out of the ordinary. The subconscious in question belongs to the show’s resident hippie, Neil (Nigel Planer), and it’s heavily influenced by Dallas, with Neil playing the part of J.R. Ewing—or, rather, E.T. Fairfax—but in a classic example of a wish-fulfillment dream, he turns the character from bad to good, selling off all of the company’s assets to the Brothers of the Soil Commune in Wales at an absurdly low price. Although his business associate, Mr. Malvinas (Rik Mayall as Neil’s roommate Rick), is initially furious, further wish-fulfillment occurs as Rick abruptly changes his tune and begins stripping off his business suit so he doesn’t “turn into a computer.” There’s a sudden turn into absurdity as E.T. and Malvinas decide to pretend they’re Indians, after which bells begin ringing; E.T.’s receptionist identifies this as the soundtrack to a grateful population “dancing in the streets and loving each other.” Before Neil can bask in the gloriousness of the world he’s created, however, he suddenly hears someone screaming, “Shut up, you bastards,” at which point he wakes to realize that he’s been listening to one of his other roommates, Vyvyan (Adrian Edmondson), cursing the bells of the nearby church.

19. Frasier, “The Impossible Dream” (1996)As much as Frasier is about a professional who deals with neurosis being exaggeratedly neurotic, it rarely gets down to the business of psychotherapy. Sure, Frasier (Kelsey Grammer) and Niles (David Hyde Pierce) often toss around barbs about their respective disciplines: Frasier is a Freudian, while his younger brother is Jungian, a distinction the show mined for almost undue hilarity. But season four’s “The Impossible Dream” is a treat precisely because it sees the Cranes picking apart a symbolically overloaded dream, in which Frasier wakes up in a seedy motel to find he’s spent the night with flamboyant coworker Gil Chesterton. Refusing to accept the obvious explanation (i.e., Frasier is gay), the two set about decoding the vision. In the process, the audience is treated to repeated dream sequences that shift as the doctors Crane approach resolution, each one capturing the free-associative unconscious state that moves freely between dream and nightmare.

20. Happy Endings, “Cocktails & Dreams” (2012)Sex dreams dominate waking life more than any other sort of nocturnal ramblings. The same is true on TV: The characters of Happy Endings wouldn’t wake up and say, “Wait, can I fly?,” but a sex dream can make them spring out of bed and wonder, “Wait, do I want to have sex with Dave?” Almost every member of the show’s ensemble has this experience in“Cocktails & Dreams,” as they envision themselves having hot romance-novel-cover-worthy sex with Zachary Knighton’s Dave, living out their dirtiest fantasies to Gerry Rafferty’s slinky “Baker Street.” Jane (Eliza Coupe) hooks up with Dave after cleaning, Penny (Casey Wilson) after a romantic log-cabin proposal, and both worry that they’re secretly in love with him—as do Max (Adam Pally) and Brad (Damon Wayans Jr.). The only regular not to have the dreams is Dave’s ex-fiancée Alex, who is on an intense cleanse. Eventually it turns out that the dreams aren’t inspired by latent feelings for the Steak Me Home Tonight proprietor: It’s his new line of specialty cocktails, from which Alex abstains. The secret ingredient? Turpentine.

21. Star Trek: The Next Generation, “Phantasms” (1993)There have been several occasions when the crew of the U.S.S. Enterprise-D has had to deal with bad dreams, but by far the most memorable—excluding the opening of Star Trek: First Contact—comes from the least likely crewmember: Lieutenant Commander Data (Brent Spiner). In the seventh-season episode “Phantasms,” Data’s so-called “dream program” delivers its first nightmare in an effort to subconsciously provide him with information to defeat a collective of interphasic creatures who are surreptitiously feeding on the rest of the crew. When he finds himself mystified as to the meanings of the various images he experiences—which include a trio of grubby gentlemen literally tearing the circuitry out of the walls, Dr. Crusher sucking the blood out of Commander Riker’s head with a straw, and a ringing telephone within his own chest—Data visits the holodeck and relates his dream to a virtual Sigmund Freud. Although Freud is positively giddy as he reels off his diagnoses (“I believe there might be a paper in this!”), his diagnosis is initially flawed, describing it as “a classic dismemberment dream… or, in your case, being a mechanical man, a dismantlement dream,” but he later assists Data in making sense of it all. Left unmentioned but certainly not unnoticed by viewers: the way Worf lasciviously devours a piece of Troi cake.