November, 2002. Sam Jones is living an ordinary miserable life as a video store clerk when a strange man called the Doctor arrives, claiming that she should be blonde and travelling through Time with him. At first she thinks she’s the butt of an elaborate practical joke, until her parents show her strange alien postcards which they’ve apparently been receiving from her for several years. She flees into the streets of London, where a ten-year-old boy attacks her with a knife, claiming her as a paradox. The Doctor saves her life, and, realizing that everything he’s said is true, she agrees to accompany him to San Francisco, where it all started.
Fitz has remained in San Fransicso to investigate the oddities caused by a reality scar which was accidentally created by the Doctor. On the eve of the millennium, the TARDIS accidentally destroyed the Earth, and the Doctor turned back Time to stop it from happening. Unfortunately, he left before realizing that space-time had not fully recovered, and three years later, the damage has become critical. The scar, located in the alley where the TARDIS first materialized, has twisted space-time through higher dimensions, and creatures which travel through these dimensions have been drawn to San Francisco and are now unable to leave again. When the Doctor, Fitz, and their version of Sam arrived, Sam accidentally fell into the scar and this dark-haired version emerged in London, unaware that anything had changed. The Doctor is now unable to stabilise the scar, for fear of losing his Sam forever, and has been forced to materialize the TARDIS around it as a stop-gap measure -- but the TARDIS is already badly damaged, and within three days the stress of holding shut the scar will destroy it.
The Doctor tries to trick Sam into getting close to the scar, but she is furious when she realizes that he’s hoping that it will switch her with the blonde Sam again. A crowd of nondescript grey men arrives in the alley and attempts to capture them, and the Doctor’s stabilising device is smashed in the confusion. Unable to find the equipment he needs to repair it on Earth, he is forced to send a hypercube to the Time Lords, asking them for help. He then learns that one of Fitz’s contacts in San Francisco is the same boy who attacked Sam in London, but when Fitz tries to lure the boy into a trap to learn more, the same boy arrives from the future to rescue himself. The Doctor realizes that the boy is an agent of Faction Paradox, but the boy clsims that he’s not the real enemy; he’s just here to keep an eye on Sam...
The hypercube fails to return from the Time Lords, and the Doctor begins to suffer inexplicable spasms and hallucinations. Fitz and Sam try to help him lure the grey men into a trap, but the grey men turn the tables on them and the Doctor barely escapes. He recognizes them as raw Henches, genetically engineered nondescript life forms which have not yet been imprinted with a service code; abandoned when their cargo ship was stranded in San Francisco by the reality scar, they have imprinted upon a new master somewhere in the city. The Doctor then learns of disturbances in the Bay and realizes that a Kraken has arrived from the higher dimensions, attracted by the energy pulse emitted by the scar. Although the TARDIS is blocking the pulses for the moment, if the scar isn’t sealed soon the Kraken will destroy the entire city searching for its food. The Doctor finally manages to contact the only man who can help him, a professor at Berkeley who has chosen the name Joyce to hide his past. Joyce agrees to repair the stabiliser for the Doctor in addition to his other work.
Sam feels herself change as a reality pulse ripples through San Francisco, and the Doctor admits that she is vulnerable due to the scar’s altering her biodata -- and that he may be responsible for her biodata being unstable in the first place. He met Sam for the first time while his own biodata was still unsettled by his recent regeneration, and he fears that exposure to him may have changed her from the dark-Sam she was supposed to be into the blonde-Sam he first encountered -- the perfect companion. The energy pulses released as the scar tries to heal itself are rippling through her biodata, causing details of her past to change. She is at first unable to deal with this revelation, but the Doctor convinces her that it doesn’t matter who she was, or will be -- only who she is, and what she does, at this moment.
One of Fitz’s contacts betrays him and delivers them into the hands of the Henches’ leader. Their enemy somehow takes away the Doctor’s ability to see the colour violet, and then implants the Doctor, Fitz and Sam with tracking devices and releases them back into the wild. When the Doctor compares the attack to the spasms he suffered earlier, Fitz realizes that they occurred at the same time that one of his contacts, a Wiccan named Kyra, tried to show him the power of the “new” ley lines in Golden Gate Park. The Doctor studies the “ley line” and realizes that it is in fact a strand of exposed biodata -- his own, which was pulled out and stretched across the city when the Eye of Harmony opened. He helps Sam and Fitz to cut the tracking units free of their bodies by using the biodata strand to cut through them in the higher dimensions in which they were attached. But he’s now in the greatest danger of his life; their enemy, who can move through the higher dimensions, has been experimenting with the Doctor’s biodata. If he discovers the high concentration of it at the scar, he will acquire the ability to change the Doctor’s entire history -- past, present, and future.
The Doctor contacts the unicorns hiding in Golden Gate Park, and learns that a man named Griffin has been collecting the unusual creatures which have been drawn to San Francisco. In order to locate them he has contacted the same people Fitz did, and he did it first, which means that Fitz’s entire network has been compromised. Fitz goes to Kyra for help, and manages to convince her that Griffin is dangerous and is trying to pin down and confine the mysteries she celebrates. She agrees to help lure Griffin into a trap, and once Griffin arrives the Doctor seals him in a pan-dimensional force field and demands answers. Griffin is a collector, determined to categorise every living thing in the Universe -- and to simplify what he can’t explain. Without any effort at all he steps through the force field and kills Kyra, and the Doctor is forced to retreat.
Sam and Fitz return to the hotel to recover from the shock of Kyra’s death, and Fitz -- who has found this dark, edgier version of Sam easier to talk to -- is surprised when she makes love to him, desperate for some human contact amidst the strangeness. When an energy pulse changes her into a heroin addict desperate for her next fix, he talks her down through the withdrawal symptoms until she changes once more. While she’s in the bathroom, Griffin arrives with his Henches, but Fitz manages to get to the phone and pretends to be warning the Doctor and Sam away from the hotel. The Henches drag him out of the room without realizing that Sam is hiding in the bathroom, and take him to Griffin’s base, where Griffin folds him up in his dimensionally transcendental specimen case for use as a hostage.
Joyce has not finished repairing the stabiliser, and the Doctor realizes that Joyce too has been experimenting with his biodata. Joyce refuses to explain why, but suggests that the Doctor learn to be content staying in one place. The Doctor leaves and summons the boy from Faction Paradox, needing his help to locate Griffin. The boy removes one of the Doctor’s childhood memories and implants another, but once he’s finished the Doctor realizes he has no way of knowing whether he really followed Griffin to his hideout in a disused music shop, whether it’s a false memory which the boy implanted, or whether the boy actually altered his biodata, causing it to really happen when it hadn’t before. Furthermore, he discovers that the boy has somehow acquired the hypercube he’d sent to the Time Lords; have they abandoned him, or does Gallifrey even exist? Did it ever? Perhaps when Life returned to Gallifrey, the shade of Rassilon made a deal with the Faction to put things back the way he wanted and prevent the Doctor from ever interfering again. Or perhaps not. But even if it did happen that way, the Faction would have had their own reasons for making the deal...
The Doctor returns to the hotel, where Sam tells him what happened to Fitz. The Doctor tries to confront Griffin, but he ignores the Doctor’s warnings about the Kraken, and the Doctor realizes that Griffin wants to observe its passing. First, however, Griffin -- unable to tolerate the fact that the Doctor’s biodata contains at least seventeen conflicting strands -- intends to pin him down to a single, easily understood definition. By doing so he will ensure his acceptance into the Society when he returns to his home, near the heart of the singularity on the Needle. Sam tries to rescue the Doctor but is captured herself, but manages to slip a pair of pliers to the Doctor before Griffin can pin her down. Griffin takes biodata samples from both her and the Doctor, but the Doctor then manages to release himself and creates a distraction, enabling them both to escape.
The Doctor must wait impatiently for Joyce to finish work on the stabiliser. While waiting, Joyce informs Sam that the Doctor’s theory about blonde Sam’s origin is wrong; even in a post-regenerative state, he couldn’t have made such sweeping changes to the biodata of someone he’d never met before. Sam realizes that she’s considering going with the Doctor once this is all over. Joyce finally completes his work and the Doctor takes the stabiliser back to the scar, only to find that it doesn’t work; it can only remove the TARDIS, which will expose the scar, attract the Kraken and destroy the city. All he can do is leave the TARDIS in the scar and hope that when it collapses its plasmic shell will seal the scar for good.
Griffin contacts Joyce, whose Advanced Research Department has been dealing with Griffin’s people for years, but Joyce warns him not to tamper with the Doctor’s biodata. While doing so, however, he inadvertently reveals that the greatest concentration is located in the scar. Griffin heads for the scar with biodata viruses he’s generated from the samples he took earlier, intending to edit both the Doctor and Sam’s biodata. Sam, believing that this is where the blonde Sam originated, attacks Griffin before realizing that he in fact intended to edit her down to a single, easily classifiable biodata strand. The Doctor threatens Griffin with the stabiliser, which can twist the higher dimensions through which he moves, and forces him to return to the music shop, where the Doctor rescues Fitz, restores his own ability to see violet, and stuffs Griffin into his own specimen box. He then takes Fitz and Sam back to the scar, where the TARDIS is finally breaking down; unable to stand by and let it die, however, the Doctor draws it out of the scar, and enters with Sam and Fitz as the Kraken rises from the Bay.
Time has slowed down inside the TARDIS as it attempts to repair itself. The Doctor builds a machine which will distract the Kraken while he finds some way to save the city, while Sam writes a letter to herself in case she is someone different when she returns. The Doctor materializes on the docks and leaves a beacon to distract the Kraken, but it will have located and consumed it by the time he gets back to the scar. The Paradox boy arrives and offers to enfold all of these events in a paradox to ensure that they don’t happen -- but in exchange, he wants the Doctor to give up Sam. The Doctor refuses to do so, and contemptuously tells the boy that he’s nobody important; just a poor kid from the barrio who wants to smash everything, including history. He is only a monster, and that’s all he’ll ever be.
The Doctor convinces Sam to ride the next energy pulse back to the scar, and he and Fitz are swept along in the wake; within the pulse, Sam sees that the Doctor is a mass of conflicting possibilities, and understands that pinning him down to what is will limit what he can be. Griffin is waiting for them back at the alley, now utterly convinced that the Doctor is insane and that the unclassifiable manifestations in the city are caused by its infection by the Doctor’s biodata. The Doctor, only half paying attention, tells Sam to use plan number 18, but this version of Sam doesn’t know what a number 18 is, and before she can tell him Griffin has attacked and is tearing his body through the higher dimensions. To save him, Sam leaps into the scar, where her biodata interacts with the Doctor’s and transforms her into a blonde, perfect version of herself. This Sam knows that plan 18 means to go for the less obvious target, and upon emerging from the scar she uses the stabiliser to open up Griffin’s specimen box. His captives, released, turn on him and push him into the scar, and Sam throws his specimen box in after him. Since the box was dimensionally transcendental, just like the TARDIS, it collapses and seals up the scar -- preventing the dark Sam from ever having existed.
Once the scar is sealed up, the Kraken departs, its food source having gone. The Doctor reconditions the Henches to serve as Joyce’s new lab assistants, and Joyce gets back to his work for the Advanced Research Department. Sam returns to London to bid goodbye to dark-Sam’s friends and achieve some closure, but she is uncertain how to react to Fitz, who knows that the Sam who was his lover is gone forever. Before leaving, the Doctor confronts the boy from Faction Paradox, only to learn that he’s played into the Faction’s hands. Blonde Sam was created when dark Sam threw herself in amongst the Doctor’s biodata, but she was only able to do so because the Doctor brought her to the scar he’d created -- and he only brought her to the scar because he’d already met the blonde Sam. Blonde Sam is a paradox created by the Doctor, and most of his eighth life has been caught up in it. Like the rest of the Faction, the Doctor no longer has a shadow. The gloating boy informs him that there is a great darkness, or greyness, coming to the Universe -- and soon the Doctor will be one of them...