After failing his exams in Theoretical Ultraphysics, student Astrabel Zar accompanies his friends, Sheabley McMung and the beautiful Zoberly Chesterfield, on holiday to Gadrahadradon, the most haunted planet in the Universe; there, amidst the spectral figures that roam the planet’s surface, he sees something that changes his life. Elsewhere, in the holiday resort of Froom-Upon-Harpwick, washed-up actor Prubert Gastridge -- best known for his role as the bellowing Vargo, King of the Buzzardmen in the Zap Daniel movie -- is offered the role of a lifetime. Across the galaxy, a number of primitive planets -- Shardybarn, Valuensis, Estebol, and Minuea, amongst others -- receive visitations from a god who changes the entire course of their civilisation...
Earth, 2004. The Doctor, Fitz and Trix visit Tate Modern for the opening of the Tomorrow Windows, an artistic exhibit which promises to give its viewers a glimpse of their most probable future and the opportunity to change what they see. The Lord Mayor of London, Ken Livingstone, recognises the Doctor and allows him past the security guards. Inside, the Doctor and Fitz examine the Windows while the bored Trix mingles with the other visitors to the gallery. The Doctor and Fitz see glimpses of their own futures in the Windows once they work out how to plug them in, and meet the exhibit’s sponsor, billionaire philanthropist Charlton Mackerel. The Doctor, guessing correctly that Charlton is not from Earth, insists that humanity be allowed to develop naturally without interference, but Charlton points out that they’ve not been doing very well so far. The Doctor is sceptical, but allows Charlton to proceed with the exhibition’s opening; however, it is interrupted when Ken Livingstone turns out to be an android duplicate with an electron bomb in his head. The Doctor has the museum evacuated while he tries to defuse the bomb, but he is unable to do so, and he and Fitz must flee as the bomb detonates, destroying Tate Modern.
Meanwhile, Trix has encountered a scruffy young student type named Martin who claims to be from the planet Frantige Two; he’s here on behalf of Galactic Heritage to save the world from Charlton. When he learns that Trix travels with the Doctor, Martin, claiming that the Doctor is his hero, uses a portable door handle to open up a portal to his flat, a rental accommodation in a distant space station. There, Trix watches the news of the bombing on Martin’s tachyon-ether relay television, and Martin admits that he’s responsible; however, he points out that nobody was killed, and claims that if Charlton had interfered in Earth’s history, it would no longer be protected by Galactic Heritage and could be sold on the open market to property developers. Martin makes tea for Trix while he explains the situation, and Trix soon begins to feel tired and passes out on Martin’s bed.
The Doctor and Fitz are attacked outside the ruins of the museum by two-dimensional, electrified creatures like flickering television projections. Charlton’s chauffeur rescues them from the creatures and takes them to Charlton himself, who identifies the monsters as Ceccecs and uses a tele-door handle to transport himself, the Doctor and Fitz to safety. His real base of operations is a space station, hidden in a secure location orbiting a distant gas giant; there, he explains that he intends to use the Tomorrow Windows to preserve the potential of endangered planets, rather than standing by while their inhabitants foolishly kill themselves off. However, he’s not doing very well, and it seems that someone is trying to kill him. The Doctor remains sceptical, and to prove that the planets in question are truly endangered, Charlton takes the Doctor to Shardybarn, a planet due to be destroyed within hours.
Trix awakens in Martin’s flat, groggy and initially unsure who she’s pretending to be today. Martin offers to reunite her with the Doctor, and uses his tele-door to transport them to Charlton’s likely next destination: Shardybarn. There, Martin and Trix meet two pilgrims named Tunt and Fim, and accompany them to a gigantic cathedral built in the shape of a huge, bellowing humanoid god. Apparently, god visited Shardybarn 1,000 years ago and promised to return one day; according to Tunt and Fim, this will occur within hours. Ever since god’s visit, the people of Shardybarn have punished themselves for the crime of being born; children’s fingers are cut off at birth to remind the people that they can never be as perfect as their god; and babies born on astrologically inauspicious days are killed lest they grow up to become criminals. Trix is appalled, especially when Martin accepts these horrors as “local customs.”
Charlton leads the Doctor and Fitz to a small hut containing a nuclear bomb wired to a distant detonator. They are captured by guards and taken to the cathedral, which the Doctor finds oddly familiar. At the cathedral, they watch as Low Priest Jadrack the Pitiful finishes flagellating himself and spills an offering of Grunt soup on the floor. Since Grunt soup was the favourite dish of the prophet Moop, it has been declared sacred and untouchable; unfortunately, since it was also the staple diet of the people of Shardybarn, they have been suffering from malnutrition ever since god’s visit. Jadrack then reveals that he’s come up with a plan to force god to return: scattered across the planet are several nuclear bombs, all wired to a single detonator. When Jadrack triggers the detonator, an unstoppable one-hour countdown will begin, and only divine intervention will save the planet. He is confident that god will return to save them, and when Charlton shows him in a portable Tomorrow Window that the planet will in fact be destroyed, Jadrack flies into a rage, smashes the Window, has the Doctor and his friends locked up, and begins the countdown.
Trix and Martin have been shown to a nearby waiting room by the Not-Quite-As-Low Priest Grigsby; there, Trix overhears the Doctor’s encounter with Jadrack. Martin does not intervene when Jadrack activates the countdown, claiming that this act is part of the planet’s natural development. The disgusted Trix parts company with him, and while Martin returns to his flat, Trix rescues her friends from the dungeons. The Doctor fetches bowls of Grunt soup from the kitchens and confronts Jadrack, threatening to let his friends drink the soup unless Jadrack allows the Doctor to shut down the timer. Unfortunately, it turns out that the detonator only sent the triggering signal; each bomb has a separate timer, which is why only divine intervention can save the planet. Disgusted, the Doctor and his friends retreat via Charlton’s tele-door while Jadrack waits out the final seconds of the countdown, confident that god will return to save them all. He doesn’t.
Elsewhere, Astrabel Zar has come to the end of a long and fruitful career as a Theoretical Ultraphysicist, despite the fact that he knows nothing about his chosen field. Now, he is nearing the end of his life, and after bidding farewell to his wife, Zoberly, he books a trip to Gadrahadradon, knowing that he will not return. On his way there, he tunes into an old movie to distract himself from thinking about what is to come -- but it’s Zap Daniel, and he instantly recognises the man playing Vargo, King of the Buzzardmen.
Back on Charlton’s space station, Charlton admits that he’s not very good at what he does, which is he needs the Doctor’s help. The Doctor notes that all of the planets Charlton is trying to protect are protected by Galactic Heritage, which seems something of a coincidence. Charlton then takes the Doctor, Fitz and Trix to the war-torn planet of Valuensis, but as he leads them to the art gallery in the underground city of the Gabaks, the city is apparently struck by an air raid. In the confusion, Fitz is separated from the others, who take cover in an air raid shelter. The Gabaks in the shelter are all suffering from radiation burns and have had limbs replaced with cybernetic implants; however, when the Doctor examines a portable radiation detector, he comes to some unpleasant conclusions. When he publicly questions the Gabaks’ lifestyle, however, the Gabaks accuse him of dissent, and turn him and his friends over to the security guards for questioning.
Fitz meets a fugitive named Tadek, who claims that the gallery has been destroyed -- but none of the levels above it were touched by the “air raid”, and Tadek believes that the gallery was destroyed by the Gabak government themselves to prevent the citizens from seeing that they could change their future. Tadek claims that the planet’s surface has been uninhabitable since the last surface battle took place 600 years ago, but he has given up all hope for the future and is heading there nonetheless, hoping to die quickly. Outside the city, however, he and Fitz discover that the planet’s surface is verdant and full of life; it has repaired itself while the planet’s inhabitants eke out their miserable existence in underground bunkers.
Fitz then spots a bizarre party of aliens led by a man espousing the planet’s desirable property values. When Fitz stumbles, drawing attention to himself, he covers by claiming to be a representative of a wealthy collector. The auctioneer, Dittero Shandy, introduces Fitz to the other bidders: Nimbit, a walrus-like alien; Vorshagg, a vicious reptile; Poozle of the Varble, which resembles a floating lava lamp; the Fabulous Micron, one of the richest beings in the galaxy, a millimetre-high creature escorted by two humanoid attendants; and two floating fur-balls, a gestalt creature whose name is the vocal intonation used at the end of a question. Tadek is unable to see any of the others, but to avoid complications, Dittero apparently shoots and kills him with a hand-held device -- or so it appears to Fitz until Dittero explains that he’s simply switched off Tadek, who was never truly alive in the first place.
The Doctor, Trix and Charlton are brought before the Gabak government and their leader, Galvakis. The Gabaks’ bodies are rotting and confined to wheelchairs, but the Doctor can detect no radiation, and he’s spotted recycled footage in the news reports; he thus deduces that there is in fact no war, and that the Gabaks are faking evidence of it to keep their people in line. Galvakis reveals that there have been no conventional battles since they and their enemies, the Aztales, were each confined to a single city. Both have created similar doomsday weapons capable of firing an electromagnetic pulse powerful enough to destroy the entire enemy city; each weapon is connected to a dead man’s switch, and will fire if its own city is destroyed. The Gabaks and Aztales are thus trapped in a stalemate, unable to destroy their enemies but unwilling to surrender. However, the Doctor questions why an EMP would kill living beings, and realises the truth: the Gabaks and Aztales themselves are long dead and have been replaced by androids with patched-on organic components, who are unable to conceive of any other way of life than eternal war. This planet is already beyond saving. As the Doctor comes to this conclusion, the Ceccecs arrive on Valuensis, and when the Gabaks open fire on the Ceccecs, they hit the controls for the EMP weapon, interrupting the signal. Their weapon thus fires upon the Aztale city, which in turn causes the Aztale weapon to fire at the Gabak city, destroying both sides and finally putting an end to the war.
As the bunker collapses about the Doctor and his friends, a tele-door opens up before them and Fitz ushers them through to safety. He’s managed to convince Charlton that his friends wish to participate in the auction, and Charlton thus allows them to attend the proceedings on Utopia, a model world constructed by the famous terraformer Welwyn Borr. Here, everything from the ambient sound to the weather can be adjusted by remote control. While the Doctor, Fitz and Charlton attend the auction, Trix decides to relax on the beach, where she finds Welwyn Borr using Utopia’s robot servants, Zwees, to film a documentary about himself. Borr offers to show Trix some of the other planets he’s designed, including a beautiful undersea world on which the water has been replaced with a super-oxygenated solution. It’s thus possible to breathe underwater and enjoy the stunning beauty of the coral reefs -- but Borr then admits that the solution is mildly carcinogenic, and that they can only stay for a minute. The solution is also killing all of the fish, and the planet must be restocked daily. The next planet he shows Trix is a gaia sphere, an entire living ecosystem which, unfortunately, has just hit puberty and has developed a hygiene problem. Borr is forced to admit that he’s made “a few errors” in the past, but nothing has ever been proven -- mainly because he always settles out of court.
Since the natives of Valuensis have destroyed themselves, the planet is no longer protected by Galactic Heritage, and its owner can put it up for sale. Nimbit, Poozle, and the Fabulous Micron begin the bidding, but when Nimbit drives up the price to 21 million Arcturan ultra-pods, Poozle requests a recess while it consults its financial backers. Nimbit retires to his rooms to relax, while a storm strikes the beach, apparently due to a glitch in Welwyn’s terraforming. The Doctor takes the opportunity to question Dittero about the auction, and how remarkably lucky it is for the planets’ owner that the native populations on his planets have begun wiping themselves out; however, Dittero takes little interest in this suspicious coincidence. Nimbit fails to return to the auction, and the Doctor discovers that someone has tampered with the gravity controls in Nimbit’s room; when Nimbit tried to turn down the gravity to a more comfortable level, he was instead crushed into paste. Despite this gruesome murder, Dittero resumes the auction, and the Fabulous Micron outbids Poozle, purchasing Valuensis for 40 million Arcturan ultra-pods.
Dittero then takes the bidders to the next planet on the auction block: Earth, which was granted protected status by Galactic Heritage because the third Princess Tabetha of Cerennis Minor once spent a weekend in 8th-century Lewisham, even though she didn’t enjoy it very much. As was the case on Valuensis, an indiscernibility field prevents the shoppers on Lewisham High Street from noticing the aliens in their midst. According to Dittero, the inhabitants of this world should destroy themselves shortly; in fact, all the experts are surprised they’ve lasted this long. The Doctor claims to have seen the future, however, and predicts that humanity will overcome the odds and prosper. The other attendees aren’t impressed with the planet in any case, and only Poozle shows an interest in bidding. The irritated Dittero escorts the others back to Utopia, but the Doctor, Trix and Charlton remain behind, intending to investigate elsewhere while Fitz tries to find out who murdered Nimbit.
Back on Utopia, Fitz questions Vorshagg, and learns that his species has a long and noble history of gratuitous violence; however, Vorshagg has been fitted with a de-aggrifier that enables him to deal with other species without immediately trying to rend them limb from limb. The Fabulous Micron’s people are immensely rich but suffer from an inferiority complex due to their size, and are thus trying to buy the Universe. Question Intonation admits to Fitz that it’s not actually here for the auction, but does not elaborate. Nobody’s quite sure what Poozle’s story is, but someone apparently tries to kill it anyway by shooting at it; however, it drives the attacker away by activating the intruder alarm. Fitz suspects that Poozle in fact faked the attempt on its own life, unless that’s too obvious. He eventually deduces that somebody reprogrammed a Zwee to reset Nimbit’s gravity controls, but the storm scrambled the Zwee’s memory circuits, so it can’t remember who gave it the order to do so -- and neither can the Zwee which tampered with the weather controls to create the storm.
Dittero takes the bidders to Estebol, a world overrun by shattered hulks of cars on rundown motorways. Fitz wanders out of the indiscernibility field and is attacked by malevolent cars, but is rescued by three beautiful but malnourished girls. The girls’ leader, Kera, explains that their people became dependent upon cars for travel after developing the internal combustion engine, so much so that now drivers are practically possessed by their cars, unable to imagine a life without them. The entire world has now been paved over and polluted in the people’s attempt to construct more cars and motorways, and soon the population will be extinct. Kera and her fellow freedom fighters are trying to destroy whatever cars they find, but the cars are fighting back, and they are run down and killed as Fitz watches. Fleeing, Fitz discovers that the people of Estebol, unable to reproduce because of their world’s pollution, have been assembling their offspring in factories, but even those factories are breaking down. Fitz shelters in a damaged car, but once inside, he feels so safe that he heads for the motorway and just keeps driving, as though possessed. Dittero tracks him down and removes him from the car via tele-door, and back on Utopia, Fitz recovers from his ordeal only to learn that, in his absence, Question Intonation has been murdered. Somebody presumably tricked it into starting to pass through a tele-door and then shut the door between the two halves, and each half of the gestalt being died when separated from the other. Fitz tries to keep an eye on the suspects during the auction for Estebol, but accidentally purchases the planet for 77 million Arcturan ultra-pods during a coughing fit; fortunately, the Fabulous Micron buys it from him for an equal amount. Shaken by the close call, Fitz goes for a walk on the terrace, where Welwyn Borr saves his life by knocking him out of the way moments before a statue falls on his head.
While speaking with Trix on Charlton’s space station, the Doctor finally remembers where he’s seen the god of Shardybarn before; it’s Prubert Gastridge, an actor from the planet Paragrol most noted for his role as King of the Buzzardmen in the Zap Daniel movie, and the Doctor also caught a glimpse of him on one of the monitor screens in the Gabak city on Valuensis. Charlton tracks him down to a retirement home built into one of the moon-sized Astral Flowers, a belt of flowers that blossom every 91 years when their orbit takes them close enough to their sun and which are used as natural cryogenic storage facilities during their ice-encrusted phase. Prubert’s Flower is about to blossom, and the Doctor, Trix and Charlton visit the retirement home to speak with him. When the Doctor reveals the purpose of their visit, Prubert admits that he had himself cryogenically frozen so that one day he would be able to confess to his crimes -- but before he can do so, the retirement home is attacked by Ceccecs. The Doctor rushes Trix, Charlton and Prubert to the shuttle bay, realising that the Ceccecs will kill everyone in the retirement home in order to get to them; however, his attempt to lure them away fails, and moments after the shuttle takes off, the retirement home explodes and triggers a chain reaction of explosions that spreads through the entire belt of Astral Flowers, destroying them all.
Back on the space station, Prubert explains that he was approached by an anonymous benefactor while playing Captain Hook in a pantomime on the resort planet Froom-Upon-Harpwick (the original Peter Pan was written by Dilvpod Tentacle, and supplied to J.M. Barrie by a visiting alien who shall remain nameless). Prubert was paid handsomely to travel the galaxy and play god, influencing the cultures of over 100 backwater planets. His employer provided him with a mask, but the conceited actor preferred to play god as himself. At first he believed that he was helping the primitive people he was visiting, but eventually he realised that he was in fact introducing “selfish memes” to the planets -- ideas so powerful that they would eventually take over the entire native culture. The Doctor, disgusted, shows Prubert a list of the planets protected by Galactic Heritage, and Prubert confirms that these are the worlds he visited. It seems that someone is engaging in property speculation on a genocidal scale, buying up protected planets cheaply and arranging for the native populations to wipe themselves out, leaving only prime real estate. The Doctor must put a stop to this, and he thus decides to visit Minuea -- and seems to make a special point of telling Trix what he’s decided to do.
Back on Utopia, Fitz addresses the bidders at auction and reveals the killer’s identity. Vorshagg is gratuitously violent, and thus could not have been responsible for premeditated murder even if he’d circumvented his de-aggrifier. Welwyn saved Fitz’s life earlier, and is too incompetent to have arranged these elaborate murders. The Fabulous Micron is so rich that it needn’t concern itself with killing rival bidders. However, Dittero has been carrying a clipboard throughout the auction, and Fitz now reveals that it’s Poozle’s remote control. Poozle is not an alien that resembles a lava lamp, but an actual lava lamp fitted with a voice synthesizer; like Question Intonation, it was here simply to drive up the price of the planets on the auction block. Apart from the Fabulous Micron, the bidders are all patsies, here to drive up the price and serve as victims for murders engineered to convince the Fabulous Micron that the planets are valuable enough to kill for. Caught out, Dittero drops the clipboard, draws a gun and opens fire on the bidders; however, Fitz grabs the clipboard and activates Poozle, and Dittero, distracted, accidentally shoots and destroys Vorshagg’s de-aggrifier. Free to kill, the gratuitously violent Vorshagg pursues Dittero onto the beach. Fitz, the only other survivor, waits for them to get clear before following the trail of destruction. Dittero has shot and killed Vorshagg and, on his associate’s instructions, has opened a tele-door to the planet Minuea. Fitz follows him through.
Minuea is the planet to which Prubert introduced the concept of democracy -- but its moon is much, much closer than Prubert remembers it being 1,000 years ago. The Doctor meets Professor Bimble Wantige at a political debate between candidates Jarkle Winkitt and Dreylon Pewt, and learns that Minuea’s scientists have worked out that the moon is going to crash into the planet within 22 years. Work had begun on a missile capable of deflecting the moon from its catastrophic course, but the project was expensive, and public opinion turned against the project when taxes were raised. Since the media gives equal weight to the opinions of those who don’t know orbital mechanics from a hole in the ground, Winkitt got into power by promising to put an end to the “wasteful” project and give everyone a tax cut. The planet’s scientists have been unable to convince anyone that their facts are more valid than the opinions of the ignorant, and Minuea thus seems to be doomed.
The Doctor decides to put himself forward as a candidate in the upcoming election, and sends Charlton and Trix back to the station to prepare another Tomorrow Window for the next political broadcast. As they work, Trix asks Charlton how he came to develop the Tomorrow Windows, and he explains that he was told their secret by his university professor, Astrabel Zar. Charlton confronted Zar when Zar apparently stole and published a thesis which Charlton had only half-finished, and Zar admitted that his career was based on foreseeing future developments in his field. He gave Charlton the secret of the Windows in exchange for his silence, and perhaps for another reason. Zar already knew where he was going to die -- back where it started for him, on the planet Gadrahadradon -- and he also gave Charlton specific descriptions of the only people to whom he could ever pass on the secret of the Windows: people who match the descriptions of Fitz and Trix.
Fitz finds people selling T-shirts in support of the Doctor’s candidacy and thus tracks down his friends before the next debate. The Doctor then addresses the people of Minuea, and reveals a devastated and dead planet via the Tomorrow Windows, showing them that they’re doomed unless they vote for him to resume work on the missile. As the Doctor wins over the people, the image in the Tomorrow Window changes to reveal a happy and prosperous people on a planet with no moon in the sky. Winkle and Pewt change their policies on the spot, both promising to resume work on the missile if elected. Satisfied, the Doctor withdraws his candidacy, as the Tomorrow Windows now show that the missile will be built and the planet saved whatever the outcome of the election.
The Doctor now agrees to help Charlton set up more Tomorrow Windows galleries on the endangered worlds to give them a chance to change their futures, since Prubert had already interfered in their development. Before they can do so, however, they must find out who’s behind all of this. The Doctor thus turns to Trix, demanding to know how she got from Tate Modern to Shardybarn. Unable to explain herself, Trix turns and bolts -- and before the Doctor can follow her, Dittero arrives and pulls a gun on Fitz. Before he can shoot, however, his head splits open to reveal that he is another android containing an electron bomb. The Doctor uses his sonic screwdriver to prevent it from exploding, and Fitz searches Dittero’s pockets and finds his tele-door handle. He and Charlton carry the android through the tele-door, dump it on the beach back on Utopia, and then return to Minuea and close the door; once cut off from the sonic screwdriver’s signal, the android presumably explodes, but as Utopia is now deserted, nobody else is harmed.
Trix runs into Martin in the street, and he takes her back to his flat -- and holds her back at gunpoint while he sends the Ceccecs after the others. The people of Frantige Two have an extraordinary long lifespan, and Martin is now 14,000 years old, at an age when he should be settling down and getting a mortgage instead of still living in a rental flat. He has thus come up with this scheme to purchase protected planets at cheap prices, use selfish memes to wipe out all life on them without being detected, and sell the planets at a fantastic profit. Charlton has been interfering in his scheme, however, and Martin was never able to find his base of operations -- until he drugged Trix and implanted a telepathic link in her neck. Ever since then, he’s been able to see the world through her mind, and through her, he’s learned the location of Charlton’s space station. He waited to abduct Trix before attacking, however, as he’s fallen in love with her after spending so much time inside her mind. Trix realises that he just has an adolescent crush on her, but nevertheless, she falls in love with him and agrees to abandon her friends for his sake. The delighted Martin is unaware that when Trix takes on a character for the purposes of a con, she plays it so well that, for all intents and purposes, she actually becomes that character -- and once Martin lets his guard down, convinced that she truly does love him, Trix knees him in the groin, grabs his gun, shoots the Ceccec control panel, and uses Martin’s tele-door to flee back to Charlton’s station.
The Ceccecs have killed Charlton’s ancillary staff, but Trix has stopped them before they can kill Charlton and her friends. When Trix returns, the Doctor soon deduces what’s happened to her and breaks the telepathic link -- or so he claims. In fact, he’s just cut part of the link so Martin can no longer read Trix’s mind, but it’s still possible for Trix to ride the link backwards and find out what Martin plans to do next. She does so, and learns that he overheard Charlton’s earlier story -- and is about to travel to Gadrahadradon to kill Astrabel Zar before he can pass on the secret of the Tomorrow Windows to his younger self. The Doctor and his friends pursue Martin to Gadrahadradon, which is not haunted by ghosts of the past after all, but ghosts of the future; the entire planet is a gigantic Tomorrow Window.
The elderly Astrabel Zar has finally returned to Gadrahadradon, but just as he makes contact with his surprised younger self, Martin catches him and shoots him dead. However, Prubert then arrives and attacks Martin, and when the mist clears, both Prubert and Martin lie dead. Fitz, Trix, Charlton -- and a fourth figure whom young Astrabel can’t quite make out -- then take the notebooks from the older Astrabel’s body and show them to young Astrabel, teaching him how to construct Tomorrow Windows. This is why Zar always knew he would die on Gadrahadradon, how he recognised Prubert Gastridge while watching Zap Daniel, and why he gave Charlton the secret of the Tomorrow Windows and described Fitz and Trix to him.
With Martin dead, Charlton can build more Tomorrow Windows in safety and undo the damage that Prubert caused. However, as the Doctor, Fitz and Trix return to Earth and the waiting TARDIS, the Doctor reveals that there will be no need to do so on Earth, as Prubert never actually finished his work there. Humanity developed the selfish memes all by itself, and will have to deal with them on its own.