England, 2005: an elderly sci-fi author named Marnal Gate dies of old age, but to his caregiver Rachelís surprise, he then regenerates into a much younger man. Some of Marnalís lost memories are restored by his regeneration, and he realises that all of the books heís written in his career are true tales of his homeworld, Gallifrey. Though unsure what caused him to lose his memories in the first place, he now understands that the cube heís been carrying around for most of his life is a means of contacting Gallifrey and summoning help. To his surprise, however, nobody answers the call. He thus has Rachel help him search his entire canonical output, until Rachel finds what Marnalís looking for in a book called The Time of Neman: coded instructions for building a temporal monitoring chamber, a bottled Universe with a one-on-one correspondence with their own. Using car batteries as a power source, Marnal tries to find out whatís happened to Gallifrey, and is shocked to find that the planet -- indeed, the entire constellation of Kasterborous -- no longer exists. Whatever happened was so profoundly destructive to the Time Vortex that Gallifrey is no longer accessible at any point in history. Marnal boosts power to the bottle with a cold-fusion generator built out of spare parts, and, following faint traces through the fifth dimension, tries to track down the being responsible for destroying his homeworld.
The Doctor, Fitz and Trix continue to roam the Universe, having adventures and fighting evil. After defeating the ruthless dictator Mondova by turning his Kyborg armies and his own daughter against him, the Doctor sets course for Earth in the year 40 BC, where an alien named Thorgan is trying to change history so humanity will not expand to threaten the Suluminian domains in 317,000 yearsí time. The Doctor removes the bomb Thorgan had planted in Octavianís villa and plants it on Thorgan himself when he shakes hands with his enemy; when Thorgan refuses to listen to reason and detonates the bomb, he blows himself up. Itís all business as usual for the Doctor, who seems oblivious to the fact that Fitz and Trix have admitted to each other that theyíve fallen in love. As the TARDIS hovers in space near Ross 128 in the constellation of Virgo, however, images of Marnal and Rachel appear in the console room. For some reason, the Doctor panics at the sight of Marnal, and he boosts the TARDIS defences and flees in a random direction.
Marnal realises that his target is himself a Time Lord, and Rachel recognises the man as the adoptive father of her childhood friend Miranda. Marnal tunes the bottle into Rachelís childhood in Greyfrith, and observes as the Doctor investigates a mysterious new type of cell phone that has become an obsession amongst Mirandaís schoolmates. The trail leads to the Provider Electronics factory, where brainwashed schoolchildren -- including young Rachel -- are constructing more cell phones to spread the alien software that has taken over their minds. The Networkís central intelligence, the Great Provider, recognises the Doctor from past encounters that he no longer recalls, and orders the children to connect the Doctor to the Network so it can tap into his intelligence. However, the Doctorís brain is more complex than the Provider had provided for, and he is able to use this connection to shut down the Network, breaking its hold on Earth and freeing the children.
After watching this episode, Marnal judges the Doctor guilty of interfering in the affairs of Earth. Rachel believes that the Doctor has saved her planet, but Marnal points out that it wasnít his to save. Marnal spends the next month tracing the Doctorís journeys to find out more about him, but his attempts to put the Doctorís adventures in chronological order all fail, and the continuity between his individual adventures flounders on contradictions. Rachel, who has nothing better to do, continues to visit Marnalís home, and eventually she points out that heís going about his task the wrong way; instead of tabulating the dry facts about the Doctorís past, he should be trying to figure out what kind of person the Doctor is and predict what he might do in the future.
The Doctor, Fitz and Trix visit Mars and prevent a familiar race from exterminating the Pope on her first official visit to the planet. The Doctor then traces a complex five-dimensional signal to London, on 6 June 2005. The TARDIS materialises in a graveyard, where the Doctor finds the signal beacon planted atop a grave -- and Fitz is shocked to see that itís the grave of their former travelling companion, Samantha Lynn Jones, who apparently died in 2002 at the age of 22. The Doctor doesnít appear to remember her, and Fitz lashes out, upset, demanding to know just why the ever-curious Doctor has never tried to find out why his memories are gone or who he used to be. Flustered, the Doctor tries to return to the TARDIS to analyse the beacon, only to find that the TARDIS has been stolen. Tyre tracks indicate that it was driven away on a lorry. The Doctor visits a police station, persuades them to let him use their computer, and hacks into the public CCTV cameras in order to trace the lorry; however, Trix notes that heís put aside the question of Samís death already, and recalls that he didnít seem to grieve even when his adopted daughter died before his eyes.
Upset, Fitz decides that heís outgrown travelling with the Doctor, and tells Trix that itís time he settled down and started living an ordinary life. Trix tells the Doctor that she and Fitz are going off on their own for a while, and takes Fitz into town to meet her bank manager -- their former travelling companion, Anji Kapoor. Ever since Anji stopped travelling with the Doctor, Trix has been passing on information about the future to her, and sheís been using it to plan her investment strategies. As a result, Anji is now one of the most powerful bankers in the country, and Trix, who gets a cut of the profits, has a net worth of over 150 million pounds. Anji invites Trix and Fitz out to dinner with herself and her fiancť, Greg, but when Fitz tries to strike up a conversation by asking Anji how many planets she thinks sheís visited, he learns to his surprise that she hasnít told Greg about her travels with the Doctor. She smoothes over the awkward moment, but Fitz realises that his ordinary life -- albeit one with a beautiful girlfriend worth a fortune -- is going to take some getting used to.
The Doctor traces the lorry to Marnalís house, but Marnal has been waiting for him to arrive, and when he breaks in, Marnal stuns him with a taser and manacles him to a chair in the cellar. Marnal confirms that he deliberately planted the beacon on Samís grave to drive a wedge between the Doctor and his current companions, but claims that he is not responsible for Samís death; she would have lived a long, worthwhile and politically active life if the Doctor hadnít stumbled in and rewritten her life history. Marnal intends to make the Doctor face the consequences of what heís done to Gallifrey, but when he tries to make telepathic contact with the Doctorís mind, he finds that the Doctor truly has lost his memories. The Doctor admits to feeling uneasy when he thinks back on his past, but claims that heís come to accept that whatever he did in the past, it was the right thing to do. Marnal disagrees, and he and Rachel bring in the bottle so the Doctor can see what he did for himself. The Doctor is disturbed to see that Marnal has refined the image with a component from the TARDIS, which means that Marnal can freely enter the Doctorís ship; indeed, he has activated its self-repair systems and is recalibrating the ship to reactivate the systems that the Doctor never used.
Marnal tunes the bottle in to observe the final hours of Gallifreyís existence. The planet has been invaded by Faction Paradox skulltroopers, who have infiltrated the Matrix and are overwriting Gallifreyan history with their own, corrupted version. Fitz sees President Romana and Mali surrounded by their enemies, and moments before he is transported away from the planet, he hears two shots ring out. In the Edifice, the remains of the Doctorís TARDIS, the Doctor is fighting Grandfather Paradox; he appears to be a future version of the Doctor, but this is because heís the embodiment of everyoneís future self, what they could be if they lose all hope for the future. The only way to stop the Faction from conquering Gallifrey is to destroy it, and, forced to choose between two evils, the Doctor fires his TARDISí weapons, draining the last of the energy holding his crippled ship together. As the Edifice begins to collapse around him and Grandfather Paradox fades from existence, he hears footsteps...
Even with the image processor, Marnal canít see beyond this point, but heís seen enough to declare the Doctor unquestionably guilty. However, the Doctor insists that the images prove that he was forced into this choice, and that if he hadnít made it, Faction Paradox would have conquered all of time and space. Marnal believes that the Doctor never tried to retrieve his memories because he felt guilty, but the Doctor is convinced that there is another reason; he still doesnít know how he was transported from the Edifice to 20th-century Earth, or whose footsteps he heard on the Edifice at the end. Unable to understand why the Doctor hasnít broken down in grief and remorse, Marnal storms off to consult his library for a precedent that will help him work out how to punish the Doctor for his crime.
Left alone, the Doctor meditates, but canít access the blocked-off part of his mind. He remembers discussing karma with a Buddhist monk, who told him that when putting a dying animal out of its misery, one must remember compassion. He has a vision of a peaceful realm of golden light, but is unable to find his way inside. He then has a vision of a man resting in a garden, who asks the Doctor how Aceís memory of her trip to Paradise Towers could be relevant. He also tells the Doctor that there are 153,841 blossoms in the garden, and that the trick to counting them is to subtract five from the end. However, the Doctor keeps hitting a wall in his memories -- which reminds him of the back wall in the TARDIS, behind which he sometimes hears a scratching noise. When Rachel enters the cellar to feed him, he tries to convince her to release him so he can investigate, but she refuses, having seen with her own eyes that he destroyed an entire planet. He insists that the world is more wonderful than she believes, but she accuses him of trying to manipulate her with cheap emotions, and leaves him locked up.
Elsewhere, Trix and Fitz go out to the pub, as Fitz wants to get back in touch with ordinary life. When he mentions that he plays the guitar, the barman invites him to participate in their open mic night. Trix convinces Fitz to try out, and he entertains the crowd with a Beatles song from an alternative timeline and a song that heís written himself, Contains Spoilers. When he and Trix return to their hotel, however, the police are waiting to arrest Trix, identifying her as Patricia Joanna Pullman and accusing her of the murder of Anthony Charles Macmillan. Fitz helps Trix to flee, and they make their way to the airport and skip the country; to her relief, he doesnít ask her any questions about her past.
Rachel tells Marnal of the Doctorís claims, and although Marnal doesnít believe that the near-infinite TARDIS could have a back wall, he finds it anyway while looking for the power room. Meanwhile, the Doctor smashes his chair apart against the cellarís concrete floor and frees himself, but decides to stay and face Marnal -- albeit on equal ground. When Marnal emerges from the TARDIS, the Doctor surprises him and knocks the gun out of his hand, but claims that heís decided to stay and work with Marnal to find out what happened to him after Gallifrey was destroyed. He points out that, while fighting Sabbath, he saw whole alternative timelines destroyed, and was sometimes responsible for their destruction -- yet he did not lose his memories due to the trauma. Thus, there must be another reason for his memory loss following Gallifreyís destruction, and if Marnal helps him find out what it is and there are no extenuating circumstances, he will submit himself to Marnal for whatever punishment Marnal deems necessary. Marnal is wary but accepts the deal -- but before they can come to any conclusions, the police arrive and surround the house, as the Doctor had called them to report a hostage situation just in case Marnal refused to accept his terms.
The TARDIS is still recalibrating, and they will be unable to use it to escape from the police siege. The Doctor tries to use the bottle to look into the future and see how the siege turns out, but somehow the cold-fusion reactor begins to overload. Marnal tries to shelter in the TARDIS, but the Doctor instead flings the reactor into the TARDIS and shuts the door, confining the explosion to the TARDIS and saving London. Marnal is furious with the Doctor for risking the last surviving TARDIS in the Universe for the sake of just a few million human beings, but is caught off guard when the Doctor opens the TARDIS door, rushes through the firestorm to the console, turns on the sprinklers and locks Marnal out.
The interior of the TARDIS has been scorched to ash, but the force of the explosion was automatically channeled through the corridors to the power room. The Doctor knows enough about the ship to understand that the eye-shaped power chamber was originally linked to an infinitely larger power source on his home planet, but since that no longer exists, the energy of the atomic explosion has cracked the Eye slightly open. Before the Doctor can seal it, a voice speaks to him from inside the Eye, offering to give him answers. The Doctor gives in to his curiosity and looks into the Eye, which shows him an event from Gallifreyís past: a Time Lord is leading a fleet of three war-TARDISes as they attack a hive of alien insects in the Shoal, a gigantic asteroid plain on the edge of the galaxy. To the Time Lordís surprise, a temporal anomaly brings down his ship near the central hive, where he finds the insects clustered around a cicatrix, a scar in space-time. A blonde woman is using technology more advanced than the Time Lordsí, either to monitor or control the cicatrix, and appears to be sending information to Gallifrey. Fearing that these unknown aliens are conspiring with the insects to attack Gallifrey, the Time Lord destroys the technology around the cicatrix, and flees moments before the asteroid explodes.
The voice from the Eye does not explain why it showed this to the Doctor, but claims that it has now had its revenge. The last time the Doctor fought this villain, his enemy fell into the Eye itself and was trapped within its singularity, given infinite power within but no way to affect the outside Universe; however, using all his power, he was able to overload the cold-fusion generator. The Doctor seals the Eye, but finds that, due to the temporal distortion caused by its cracking open, heís been in the crypt for over an hour. He finds his way back to the console room, past the ďback wallĒ -- which is now slightly cracked -- and sets course for the planet Klist, where the TARDIS can relax and repair itself. On the way, he decides to write an autobiographical novel about the events that took place on the Edifice. He decides to make the footstepsí owner a sarcastic woman, but he canít decide what to name her, as heís forgotten that the Buddhist monk told him to remember compassion. In the course of their conversation, he tells the woman about Aceís memory of Paradise Towers, created when he accidentally planted one of Melís memories in her mind with the TARDIS telepathic circuits. The memory of this accident apparently gave the Doctor a plan, but this is as far as he can get in his ďnovelĒ, and he doesnít remember what the plan was.
Marnal is shocked when the TARDIS dematerialises, but Rachel realises that heís frightened as well. He doesnít explain why, but soon Rachel can sense something wrong, as if a storm is brewing. Marnal rewires his maser gun to induce an emotional state of indifference in the police, but before he can use it on them, the siege is called off -- as a second moon has appeared in the sky, and giant insects begin to swarm over the Earth. Marnal has been expecting this, and he and Rachel barricade themselves in the house. Marnalís next-door neighbour, Mrs Winfield, watches in horror as the insects exhale white dust over her husband and he dies before her eyes. The same happens to tens of thousands of people caught in the open as the insects swarm across Europe.
Trix and Fitz are in New York when they hear news of the attack. UNIT has named these insects the Vore, and the armies of Europe are helpless against the swarm. Assuming that the Doctor will be in the thick of things, Trix and Fitz charter a private plane back to Great Britain, as the swarm seems to be following daylight and is now over Guinea-Bissau. Though the bulk of the swarm has left, however, there are still individual Vore in the country, and when their plane arrives, the Vore bring it down by flying into the jet engines. The pilot manages to crash-land intact, but as the planeís occupants flee, the Vore land between Trix and Fitz. Realising that the insects havenít decided which of them to attack, Fitz steps forward and deliberately draws them away from Trix, who watches helplessly as the Vore exhale the white dust over Fitz. The plane then explodes, killing these Vore, but Trix has already seen Fitz die.
The Doctor passes the time by reading some of Marnalís books, and in a book describing the Time Lordsí Matrix, he finds a strange bookmark, a plastic print-out of a Matrix projection detailing how the destruction of the cicatrix changed history. The Vore were originally to evolve into a benevolent species, but because of the Time Lordís attack, they were scattered throughout the Shoal and developed into a hostile predator species and a possible Last Contact for Gallifrey. The Doctor is more interested in the Matrix itself, described as a storehouse for the minds of dead Time Lords -- and for the first time, it occurs to him to wonder what he has instead of his memories. Cheered by the thought, he returns to the damaged back wall and breaks through, and on the other side, he encounters a robot dog named K9 who tries to kill him. Unable to outrun K9, the Doctor tries speaking to him instead, and learns that K9 is one of his former travelling companions. After they parted company, K9 became a covert operative on Gallifrey, and when Faction Paradox attacked the Time Lords, Romana sent K9 to the Edifice to kill the Doctor in order to prevent his future self from existing to lead the attack. Fortunately for the Doctor, Fitz reconfigured the TARDIS infrastructure to trap K9 behind the back wall. The Doctor asks K9 to scan his brain and find out what he has instead of his memories, and once K9 does so, his previous orders are automatically rescinded; the Doctor must be kept alive at all costs.
Nearly 10 million people have been reported dead in the Vore attack, for which Marnal blames the Doctor. The Vore break into his house and take him and Rachel to the second moon, where Marnal realises that theyíre tracking the Doctorís TARDIS. Confident that he can outwit the Vore and escape, he offers to call back the Doctor in exchange for the Vore sparing his and Rachelís lives. The Doctor receives Marnalís psychic call, warning him of the attack on Earth, but K9 identifies the insect in the corner of the transmission signal as a Vore. Since they are a possible Last Contact, the Time Lords have been forbidden from interacting with them. However, the Doctor refuses to leave Earth to the monstersí mercy, and reverses course. The Vore snag the TARDIS in a web of five-dimensional tunnels and draw it to the second moon, where they capture the Doctor -- but as Marnal gloats over his victory, the Doctor reveals that the Vore do not communicate by sound, and that Marnal did not in fact make the deal he thought he had.
Unable to cope with knowing that Fitz is dead, Trix decides to track down the Doctor. On the way to Marnalís home, she sees soldiers burning the bodies of dead Vore, and learns that the living Vore are repulsed by the smell. She thus collects the body of a dead Vore, and when she arrives at her destination, she burns the body and lets the smoke permeate her clothes. Jackie Winfield sees Trix, and the two women share their grief over the loss of their loved ones; Trix realises that she was drawn to Fitz because he was stolid and dependable, and she could trust him with her life. She and Jackie enter Marnalís home to search for signs of the Doctor, and when a stack of books falls over for no apparent reason, Trix picks one up, discovers that it contains a description of a TARDIS, and realises that the Doctor was lured into a trap by one of his own kind. Meanwhile, as the governments of the world scramble to deal with the Vore, analysts discover that the insects are building a new hive in Guinea-Bissau, like a termite mound the size of a mountain.
On the second moon, the Doctor studies the Vore and concludes that, despite their complex behaviour, they are not intelligent life forms but are following patterns of instinctive behaviour. They have travelled through five-dimensional tunnels to the Earth, and intend to chew up all life on the planet and use the vomit to fertilise the fungus on which they live. Marnal plans to escape in his TARDIS, and the Doctor realises that Marnal is referring to his own Type 40; the Doctor stole it when he first fled from Gallifrey long ago, and before that, it belonged to Marnal. The Doctor suddenly pushes Marnal and Rachel over the edge of a 70-foot-drop, but this is because heís realised that theyíre on a moon with one-sixth of the gravity of Earth, and they thus fall slowly to a soft landing in the fungus. Once coated with the fungus, they smell like food, but since the Vore operate entirely by instinct, they should be safe as long as they stay out of the areas of the nest designated as eating areas. Marnal tests this theory by shooting a Vore; the others do not respond to the attack, but simply drag the dead Vore out of the farm.
The Doctor realises that it was Marnal, in his previous body, who destroyed the Voreís hive in the Shoal; however, Marnal does not remember what happened after he returned to Gallifrey. In fact, he was sent only to observe the Vore, and launched the attack on his own initiative -- with dire consequences, as the Matrix projection has established. When he returned to Gallifrey, he was confronted by his political enemies: the Time Lord Ulysses; his human wife, Penelope; and Mr Saldaamir, the last survivor of a species wiped out in the ancient Time Wars. The blonde woman from the Shoal was in fact Larna, a Time Lady from Gallifreyís future who had been working with Ulysses to monitor and control the cicatrix. Marnalís attack on the Shoal threatened their work, for if placed on trial, he threatened to reveal the existence of a prophecy known only to the inner Council. The Time Lords were soon to suffer a series of attacks, followed by Last Contact and the fall of Gallifrey, but a child then living would grow up to become the saviour of the Time Lords. If this prophecy were to be made public, there would be chaos and confusion on the planet, Ulyssesí project would come under scrutiny, and the Time Lords would learn of his own transgressions of the Laws of Time. Ulysses thus knocked Marnal unconscious, erased his memories, and abandoned him in England, 1883, under the care of Penelopeís mother, Mrs Gate.
Marnal is aware of little of this, but he is furious with the Doctor for pointing out his own mistake. Before he can shoot the Doctor, however, the Doctor reveals that heís found out what happened after Gallifrey was destroyed. When he fired his TARDISí weapons systems, the future Faction Paradox was erased from the timelines and its corruption was thus removed from the Matrix -- and in the few seconds remaining before Gallifrey was destroyed, the Doctor deleted his own memories and stored the entire contents of the Matrix in their place in super-compressed format. The Doctor has stored the minds of every single Time Lord within his brain -- 153,841, except for the five who escaped. Presumably, he had a plan to rebuild Gallifrey, but if so, he accidentally deleted it along with his other memories. This is the real reason heís been so averse to recovering his past; restoring his memories or accessing the super-compressed Matrix in their place would either have killed him from shock or overwritten the contents of the Matrix, destroying them beyond hope of recovery. Now, the Doctor and Marnal have a chance to build a new Gallifrey together -- but first, the Doctor insists upon saving Earth from the Vore.
The Doctor, Marnal and Rachel return to the TARDIS, only to find it guarded by Vore who respond to their arrival as a threat. Before the Doctor can come up with a plan to get past them, Marnal opens fire with his indifference gun, clearing a path; however, he is skewered by one of the Vore before he can reach safety. The Doctor and Rachel drag Marnalís body into the TARDIS, but he reveals that heís on his last incarnation. He is content that the Doctor can restore Gallifrey if anybody can, and as he dies, the Doctor tells him that he was the Doctorís childhood hero. Since there is no longer an active Matrix, Marnalís remaining secrets die with him. The Doctor then dematerialises the TARDIS, and instructs Rachel on how to keep it thrashing about in the Vortex while the Vore try to drag it back to their moon. While she is doing so, he returns to the power room, where the voice from the Eye reveals that it took advantage of the Doctorís curiosity; when he hesitated before closing the Eye back on Earth, it remained open long enough to create a new space-time scar, a cicatrix that drew the Vore to the Doctorís favourite planet. However, the Doctor now opens the Eye again and orders K9 to drop the TARDIS defences. The Vore instinctively transport their moon through the tunnels to the new cicatrix -- and the entire moon falls into the Eye and is destroyed by the power within.
Trix and Mrs Winfield are attacked by Vore after the second moon explodes, but the Doctor arrives and frightens the Vore off. Trix tells him that Fitz is dead, but the Doctor holds her hands and shows her that Fitz is in fact standing right next to her, just as Mrs Winfieldís husband has been with her all along. The Vore have evolved a method of demoralising their enemies by exhaling a dust that affects the human brainís perceptions; people believed that the dustís victims were dead, and their brains simply ignored all of the sensory evidence to the contrary. Since the Doctor is not human, he can still see the many millions of ďdead,Ē but it will take some effort to convince the rest of the human race that their loved ones are still alive, and in the meantime, many of the ďdeadĒ will have been buried, cremated, or even committed suicide from despair.
As Trix, Fitz and Rachel load the contents of Marnalís library into the Doctorís TARDIS, the Doctor uses his government contacts to get in touch with the United Nations and spread the truth about the Voreís victims. Fitz admits to the Doctor that his own muddled memories of Gallifreyís destruction were restored on Espero, and the Doctor theorises that he tried to erase Fitzís memories to protect his secret but didnít do a good enough job. In the meantime, the Doctor sends K9 to Espero on a secret mission, and with the help of a certain General Lethbridge-Stewart, he and his companions -- including Rachel -- visit Guinea-Bissau to attack the Vore hive. Before the Doctor can set about restoring his home, he must save the Earth; maybe heíll fail, but maybe heíll succeed and save the world. The only way to find out is to try...