The Keeper Of Traken
The Doctor and Adric learn from the wizened Keeper of Traken that a great evil has come to his planet in the form of a Melkur - a calcified statue. The Keeper is nearing the end of his reign and seeks the Doctor's help in preventing the evil from taking control of the bioelectronic Source that is the keystone of the Traken Union's civilisation.
The Melkur, via various deceptions, becomes the next Keeper. It is then, however, revealed to be the Master's TARDIS. Its owner, still blackened and emaciated, hopes to use the Source's power to regenerate himself. The Doctor manages to expel him and install a new Keeper in his place, but in a last minute ploy the Master traps one of the Traken Consuls, Tremas, and merges with his body before fleeing the planet.
The Doctor takes Adric and a young air hostess named Tegan Jovanka, who has come aboard the TARDIS by accident, to the planet Logopolis, home of a race of mathematicians whose help he hopes to enlist in reconfiguring the outer shell of the TARDIS.
The mysterious, wraith-like Watcher brings Nyssa from Traken to join them and warns of impending danger - something that is borne out as the Master arrives and kills a number of the Logopolitans.
The Logopolitans' leader, the Monitor, reveals that the universe passed its normal point of heat death long ago and has been preserved only by his people's calculations, which - by way of a signal beamed from a perfect copy of the Pharos Project radio telescope on Earth - have kept open numerous CVEs through which the excess entropy can drain.
This process has now been halted by the Master's interference, and the Doctor is forced to join forces with his arch-enemy in order to save the universe.
Their plan is to use the real Pharos Project to transmit a copy of the Logopolitan program and thus keep open the CVEs, but the Master seizes the opportunity to blackmail the peoples of the universe by threatening them with destruction unless they agree to his demands.
In foiling this scheme the Doctor falls from the gantry of the radio telescope. As he lies injured on the ground the Watcher appears again and merges with the Doctor as he regenerates.
The newly regenerated Doctor escapes with his companions back to the TARDIS. Suffering from post-regeneration trauma, he only narrowly manages to save the ship from destruction as it plunges back to Event One, the hydrogen in-rush that preceded the creation of the universe.
He then seeks sanctuary in the peaceful domain of Castrovalva, only to discover that it is an illusory, dimensionally paradoxical trap set for him by the Master with the unwilling aid of a kidnapped Adric. The Doctor eventually wins the day by enlisting the help of the Castrovalvan people who, although also part of the Master's creation, are nevertheless able to exercise free will.