Bart embarrasses Principal Skinner by altering a weather balloon to make it look like Skinner’s bare bottom. As punishment, Skinner sentences Bart to assist him with his amateur astronomy project—which begins at four-thirty a.m. each morning. While surveying the nighttime sky, Skinner catches a glimpse of the offensive weather balloon and sets out to reclaim it. During his absence, Bart spots a comet and reports it to an observatory. The scientists at the observatory congratulate the boy for his discovery. Skinner is crestfallen.

Bart names the celestial object "The Bart Simpson Comet" and receives accolades for his discovery. But his new found fame proves disastrous when it becomes apparent that the comet is on a collision course with the Earth-even worse, it’s on a collision course with Springfield. Scientists plan to launch a missile that will intercept the comet and blow it to pieces. The rocket, however, misses the target and returns to Earth, destroying a crucial bridge that leads out of town.

With the comet’s collision imminent, and evacuation impeded by the destroyed bridge, the people of Springfield begin to panic. Left with no other choice, Homer reluctantly moves his family to safety by joining Flanders and his family in their bomb shelter. But they are soon joined by most of the residents of Springfield, who squeeze their way into the tiny space. The decision is made to send one person out of the shelter so others can breathe. Homer volunteers Ned Flanders, and Ned, being the Good Samaritan, agrees to sacrifice himself. But everyone, especially Homer, begins suffering from horrible guilt about Flanders. Homer opens the shelter door and steps outside. The others join him. They join Ned in a chorus of "Que Sera, Sera." As the comet enters the Earth’s atmosphere, it encounters a thick layer of pollution. It begins breaking up, until only a few small pieces remain.