After Bart and Lisa's slumber party fighting drives him to distraction at home one night, Homer visits Moe's Tavern, where he finds Moe is struggling financially as fewer people are drinking in bars nowadays and he ran out of Duff Beer after neglecting to pay his distributor. Homer tells him about a drink recipe that he accidentally invented one night, called the "Flaming Homer". He explains that after Patty and Selma made the Simpson family watch slides from their latest vacation, he was unable to find a beer. He decided to mix together drops of liquor from near-empty bottles and accidentally included a bottle of Krusty Brand non-narcotic cough syrup. When Patty dropped cigarette ash in the drink and set it on fire, Homer discovered that fire greatly enhanced the taste of the drink.
Moe tries making Homer's drink, and gives it to a customer, who loves it. When the customer asks what the drink is called, Homer starts to respond, but Moe butts in and calls it a "Flaming Moe". Word of mouth spreads, and Moe sees his business boom because of the drink. To help out with the extra customers, he hires a waitress named Colette. Moe's Tavern, renamed "Flaming Moe's", soon becomes one of the trendiest nightspots in Springfield and Aerosmith's new hangout. Homer becomes angry with Moe and vows never to return to the tavern. He subsequently becomes obsessed with Moe and his betrayal, even having a hallucination where he sees Moe's face everywhere.
A restaurant chain becomes interested in purchasing the recipe for the drink, of which they have managed to identify all but the secret ingredient (cough syrup). A representative offers Moe $1,000,000, but he refuses. Colette quickly discovers that Moe stole the recipe from Homer and not only makes him promise to sell the drink, but also apologize to Homer and give half of the money to him in compensation. Later, as Moe is about to accept the deal — and share half of the money with Homer — Homer, unhinged by resentment, arrives at the tavern. He gets his revenge on Moe by revealing to everyone in the bar that the secret ingredient is "nothing but plain, ordinary, over the-counter children's cough syrup!" The representative quickly retracts the offer and leaves.
Within one week, nearly all restaurants in Springfield are serving "Flaming Moes", and Moe's business has gone back to the way it was before. Homer stops in, and he and Moe reconcile. Moe gives Homer a "Flaming Homer" free of charge.