Using the Arc of Infinity an anti-matter creature has passed over into the normal Universe. In order to be able to co-exist it needs a physical presence - and the Doctor's bio-data extract is chosen. Using the bio-data extract the creature enters the TARDIS and bonds with the Doctor.
On Gallifrey the High Council decide that the only way to destroy the creature would be to terminate the Doctor, to which the Doctor reluctantly agrees.
Meanwhile on Earth Tegan, who got the sack from her job, visits Amsterdam to find her cousin, Colin Frazer, to find that he has disappeared. Visiting the crypt where he had been staying Tegan finds the Ergon.
On Gallifrey the traitor is revealed to be Councillor Hedin, and the creature is revealed to be Omega. The Doctor finds that Omega is on Earth, and travels there in the TARDIS, where he finds Tegan again. The bonding with the Doctor is incomplete, and if it is not finished there will be an anti-matter explosion.
The Doctor uses the Ergon's matter converter against Omega as he wills his own destruction, and he fades away as Tegan rejoins the crew.