When Homer is outraged by the family's high electricity bill, they attend an alternate energy expo and purchase a wind turbine. At first the turbine produces an excess of electricity, so Homer decides the family will live off the grid. They soon discover that they have no electricity when there is no wind. Homer tries to power the turbine with fans plugged into Ned Flanders' house, but Ned angrily disconnects them. One evening Bart is manually turning the turbine so Lisa can watch House, and when he prays for wind, a severe storm blows through town. The next morning Lisa and Bart bike through town to survey the damage and discover a beached blue whale.
Lisa immediately bonds with the whale and names her Bluella. She appeals to her parents for help returning Bluella to the sea, but Marge fears Lisa will be let down because the outcome for beached whales is usually poor. Still, Homer rallies the townspeople and they unsuccessfully attempt to move Bluella. As night falls, Lisa decides to stay with Bluella and starts reading her excerpts from the poem "The World Below the Brine" from the poetry collection "Leaves of Grass" by Walt Whitman. She dozes off and awakes to the Marines rescuing Bluella with helicopters. Bluella happily swims away but when she leaps into the northern lights (a reference to the animation of Respighi's Pines of Rome in Disney's Fantasia 2000), Lisa awakes, realizes she was dreaming and discovers Bluella has died.
Homer tries to comfort a heartbroken Lisa, while Bart and Milhouse, who plan to poke Bluella with a stick, return to the beach and discover the police are going to blow up the whale carcass, as it cannot stay on the beach. The results are disastrous and blubber is everywhere, prompting the townspeople to use Bluella's remains for products such as corsets and perfume. Lisa sadly walks through town, where every squeaky noise reminds her of Bluella. She winds up at the beach, where she spots two whale calves — presumed to be Bluella's offspring — surrounded by sharks. Homer suddenly appears with a boat (which he had apparently offered to test drive) and a harpoon and they rush to the rescue, only to be stopped by two eco-activists, who caution Lisa that being an eco-activist means supporting all forms of life (including sharks but excluding cockroaches). Lisa agrees and stops Homer from shooting the sharks, but he inadvertently falls overboard. The eco-activists advise Homer to hit the sharks on the nose with a steel pail, which will either cause them to retreat or make the sharks devour Homer faster. When the eco-activists throw the pail to Homer, it strikes him in the head causing him to bleed and even more sharks arrive and circle Homer. Fortunately, the whale calves' father appears and rescues the young whales and Homer, driving the sharks away. In the end, the Simpson family watches the three whales swim out to sea, confident that they will thrive. Homer assumes that the whale will get married to a "sexy lady octopus", and that a "little whale-upus is on the way!" Marge then suggests that they draw pictures of that tonight. Over the ending credits, the song "La Mer" plays while the pictures the Simpsons drew are shown.