The Fourth Doctor and Leela arrive on the planet Pluto just in time to prevent one of its citizens, Cordo, from committing suicide over his energy bill. The monopolistic energy company on Pluto is using its economic stranglehold to extract ever growing taxes and those who refuse to pay are forced to live in the dark tunnels of the Undercity. The Doctor, Leela and Cordo venture to the Undercity, where they encounter thieves and dropouts led by the brutal Mandrel. Mandrel tells the Doctor that he must use a stolen card to obtain money from a cashpoint or Leela will be killed. When the Doctor tries the stolen card, he trips a security system which floods the cashpoint chamber with noxious gas and he falls unconscious.
When the Doctor awakes, he is in a Correction Centre alongside another detainee, Bisham. The Doctor is released by Gatherer Hade, who wants his movements tracked, believing the Doctor will lead him to the heart of a conspiracy against the Company. Leela, Cordo and K9 attack the Correction Centre and are taken prisoner by the Collector's personal guard.
The Doctor, Cordo, Bisham, and K9 return to the Undercity and persuade the Undercity dwellers to revolt. Their first target is the main control area where the Company engineers PCM, a fear-inducing drug piped into the air supply which helps keep the population servile.
Leela is presented to the Collector, who orders her steamed to death. The Doctor saves Leela, but the microphones set up to relay her death screams instead broadcast Mandrel warning the Doctor of how little time he has left to rescue her. The Collector is incensed and even more troubled when the revolution starts spreading. Gatherer Hade, investigating reports of citizens going onto the roof to look at the city's sun, is thrown to his death from the top of his Megropolis, and his underling, Marn, joins the revolution.
Leela and the Doctor head for the Collector's Palace, where the Doctor sabotages the computer system. The Collector arrives and is challenged by the Doctor, who discovers that he is a Usurian, a seaweed-like sentient poisonous fungus, from the planet Usurius. The Doctor denounces his operation on Pluto, which had consumed Mars as well after the Earth had become non-viable. Before the Collector can implement a plan to exterminate the population of Pluto with poison gas, Cordo and the lead rebels help the Doctor defeat the remaining members of the Inner Retinue. The Collector checks his computer to find the Doctor's input has resulted in projected bankruptcy, and the shock causes the Collector to revert to his natural state in a compartment at the base of his wheelchair. The Doctor seals him in, and he and Leela depart with K9, leaving Cordo, Mandrel and the others to contemplate recolonising the Earth.