The Doctor is disturbed by the unresolved issues from the Yemaya incident; who created the telepathic computer SLEEPY, and why can he find no trace of them? Seeking answers, he finds instead a hole in reality in the middle of 21st-century Arizona, and where he was expecting to find a convention of alien abductees he finds instead a dying gynoid, a creature as like a woman as an android is like a man -- a creature simply allowed to happen rather than being designed. Worried, he gives Roz a Time Lord device called an amaranth, but before he can tell her how to use it she falls through the hole and ends up in a monster desert, the home of nightmares and birthplace of gynoids. The amaranth tries to transport her to safety, but in the confusion she loses it and is stranded in the town of Woodwicke, New York, in 1799, with no hope of rescue.
It is the dawn of the Age of Reason, and America is a brand-new country which has not yet decided upon its national identity. Roz moves into the home of a businessman who is away in Asia, pretending to be his housekeeper, and ekes out a living telling fortunes at the local carnival. But as Christmas approaches, the uncertainty of her situation becomes too much for her to handle; in this era, nobody knows how to react to a strong and independent black woman, and she doesn’t know how to respond to them. Finally, she learns that a local businessman is named Samuel Lincoln, and decides to kill him, believing that by killing Abraham Lincoln’s father she will change history and alert the Doctor to her location and predicament. The Doctor finds her just in time to stop her from shooting Samuel, but angrily tells Roz that Abraham Lincoln’s father is named Thomas and lives in Kentucky.
Young urchin Daniel Tremayne is seeking employment in Woodwicke. Having already been turned away by Roz, he heads for the home of Matheson Catcher, but hears voices chanting in the cellar -- a digital chant of alien ones and zeros that echoes inside his head and remakes the world. Catcher and his Rationalist followers are initiating a new member into their circle, the blowhard Erskine Morris, whose loud claim to be a rational man was overheard by Catcher. Blindfolded and left to wander through a cellar larger than Catcher’s entire house, Morris pushes his way through a throbbing organic mass which seems to peel away around him, and finds himself in a room with a strange hexagonal table like an altar in the centre. There, Catcher claims that he has passed the test; by facing down an agent of Cacophony, he has proven himself to be a Rational man, capable of imposing Order upon the Chaos of the natural world. Morris leaves with the rest of the Rationalists, shaken by his experience and no longer sure what he believes in. Catcher remains to repair structural damage to his rational domain with the amaranth, which he believes to be a gift of the Watchmakers he serves. On a window-like screen, he sees a blue box in the forest, its dimensions shifting and unstable, and concludes that it is an engine of Cacophony, brought to Woodwicke by an enemy of Reason. Meanwhile, Daniel finds visions of history unfolding in his mind, and tries to find the witch-woman Roz to make sense of what is happening to him.
Chris explores the TARDIS in the Doctor’s absence, and finds an Interface unit created by a former occupant which allows him to directly access the mathematical core of the TARDIS. Intrigued, he fiddles with the Interface and inadvertently deletes part of the TARDIS before realising that there is no fail-safe. The TARDIS, already struggling to resist an outside influence which is affecting its stability, starts to fall apart around the hole which Chris has created, and creatures made of clockwork bleed out of the cracks and pursue him through the disintegrating ship. The Doctor and Roz return only to find that the TARDIS has taken on the texture of a rotting organic object, and that they are unable to get in. The Doctor, infuriated, sets off to put things right, telling Roz that something in this era is making cracks in the rational Universe. When Roz fell through one such crack, the amaranth brought her to the source of the trouble -- but it has since fallen into the wrong hands. Someone in Woodwicke is taking apart the Universe and is trying to put it back together again in a new pattern.
French secret agent Marielle Duquesne arrives in Woodwicke, having been sent by the Shadow Directory to investigate Catcher’s cadre of Rationalists. Marielle possesses a certain sensitivity she knows only as the Sight, and through it she realises that there is a caillou present -- one of those rare creatures which bends history around itself, and which the Shadow Directory was set up to control. She follows her intuition to the TARDIS, but slips through a crack in its structure and finds herself inside with Chris, pursued by the clockwork creatures. Interface observes their interaction, and realises that Marielle is subtly prompting Chris for information. It accesses the TARDIS data banks and learns that a French psychic in this era is likely an agent of the Shadow Directory -- with orders to exterminate any caillou that cannot be controlled. Interface tries to warn Chris, but cannot get through to him due to interference from telepathic pulses which seem to be coming from the very heart of the TARDIS itself. Chris, meanwhile, is having flashbacks to a childhood memory of watching in pride as his father foiled a dastardly bank robbery.
The Doctor, sensing gynoids gathering out of the corner of his eyes, takes Roz to an empty church and challenges his enemy to show itself. The stained-glass window explodes into a new shape -- a glass gynoid which seems to encompass all Creation in its reflections -- but before he can learn anything from it, a crowd arrives, attracted by the sound of shattering glass, to see the Doctor trying to communicate with the monster he has summoned. Frightened, they attack him, and although Roz escapes from the mob, the Doctor is beaten senseless and brought before the town Council to explain himself. Catcher attends the emergency meeting and informs the Councillors that the Doctor is a diabolist attempting to summon the forces of Cacophony. The confused Councillors agree to let Catcher’s followers try to restore order, but the Rationalists are just as confused and frightened as anybody else. In the face of uncertainty, rumours about Satanists and unnatural forces spread across town, and an angry mob descends upon the carnival and tears it apart. When the Rationalists descend upon the village’s ghetto, seeking Roz amongst the slaves, the town erupts into a full-scale riot, and those who try to speak out against the violence only become part of the chaos themselves. The French agent Tourette, concluding that Marielle has failed -- and already upset with her for spurning his advances -- sends word to his superiors, who decide to send in a chirurgeon to put things right.
In the midst of the chaos, Daniel finds Roz and begs her to save him. He has never had any time for history, regarding it as a game for presidents and kings; the best that ordinary people like him can do is keep their heads down and try not to be noticed. But ever since he heard the voices in Catcher’s cellar, history has got into his head and he can’t get it out. Roz realises that the amaranth must be in Catcher’s cellar, and has Daniel take her there. When she breaks in she recognises Catcher’s new, “rational” cellar as a TARDIS console room -- but one which seems simply to have happened, rather than having been built to order. When Catcher tried to remake his home along Rational lines, the amaranth must have used the TARDIS as a template -- but since its creations are inherently temporary, this unTARDIS is falling apart, and as it is linked to the real TARDIS that is causing the real TARDIS to break up as well. Roz takes the amaranth, intending to return it to the Doctor, but as they leave they run right into the heart of the rioting. Daniel instinctively strikes down a man who was about to kill Roz, saving her life -- but knows that he has now become involved in history, and that there’s no way out for him.
Catcher interrogates the Doctor, who realises that Catcher has been touched by an irrational force so powerful that Catcher’s very biology is changing on a fundamental level. Catcher accuses the Doctor of releasing Cacophony upon the world, and, realising that there is no reasoning with him, the Doctor distracts Catcher and escapes. Infuriated, Catcher demands that the Doctor be found and burnt at the stake, and returns to his home -- where he finds that the amaranth has been stolen. Armed with a galvanistic electrostatic rifle, another gift from the Watchmakers, he hunts down Roz and Daniel, and as Roz tries to calm him down the terrified Councillor Isaac Penley arrives, seeking someone who can make sense of what’s happening to his town. He sees Roz and hysterically accuses her of being a witch, and Catcher opens fire, but misses Roz and blows Isaac to bits. As Roz and Daniel flee, the horrified Catcher tries to put the bits of Isaac’s body back together, using stones and twigs to fill in the missing bits.
Chris and Marielle seek shelter in the TARDIS library, but it falls apart around them, leaving them trapped in a small room containing a Universe in a bottle. Chris is still having vivid flashbacks to his memory of the bank robbery, and Interface although tries to contact him, the TARDIS falls completely apart before Interface’s warning is delivered. Marielle and Chris are lost in the cracks in the rational Universe, in danger of falling into the Vortex, where Marielle can hear the anguished cries of those trapped outside Time. Trying to impose sense upon her perceptions, she finds that she has created an illusory Paris, where Chris is arrested and marched to the guillotine by clockwork soldiers. A clock with a shattered face speaks to Marielle, telling her that this is the ultimate outcome of Reason and history -- and that if she chooses to live in this world she must bear its consequences. To save Chris’ life, Marielle finally admits that there is more than this to the Universe. She has never been given a rational explanation for her Sight, and has seen things in her time with the Shadow Directory that she cannot explain. She no longer believes that they can or should be explained at all, and when she stops trying to do so, she gives a face to Irrationality, and allows it back into the rational Universe.
The Doctor tries to impose order upon the riot, but he is attacked by Raphael, the chirurgeon sent by the Shadow Directory to expunge the irrationality consuming Woodwicke. Assuming that the Doctor is the caillou responsible for the madness around him, Raphael is about to kill him, but then Marielle makes her choice and Irrationality really arrives. The sky turns monster-dark, the rain falls in chaotic patterns, and Raphael’s scalpel -- a device salvaged from an alien spacecraft and tuned to kill monsters -- starts turning on everything in the vicinity, including Raphael himself. The reshaped Isaac Penley is impossibly restored to life by the irrational rain, and the Rationalists find their bodies mutating. Just as they are about to be burned at the stake by their frightened fellows, the Doctor arrives and asks Morris what he really believes in. Morris realises that all he really wants is a quiet, happy, ordinary life -- and when this understanding calms him down, his body returns to normal. The Doctor leaves Morris and the Rationalists to restore reason to the town, while he heads for Catcher’s house -- but he knows that the irrational rain is changing even him, in ways too subtle to detect. Young initiates on Gallifrey are known to play the dangerous game called Eighth Man Bound, in which it is possible to intuit their possible futures -- but even the best player of the game was never able to see beyond his seventh incarnation...
Chris finds himself in the irrational desert, birthplace of gynoids and home of the Carnival Queen, who has finally been given form by Marielle Duquesne. Long ago, the Universe was a wild and irrational place, until the terrified Watchmakers created logic and Rationality and ruled the impossible out of existence. Before their time, anything was possible; but after they imposed Order, the Universe became a clockwork set of rules which they could predict and control. Their last act in the irrational Universe was to expel their own irrationality, a gestalt of superstition they sealed away outside the rational Universe. This is the Carnival Queen, and she knows that superstition is what makes life worth living; the irrational belief in justice, fairness, and that one individual can really make a difference. Chris is not sure what to make of the Queen’s claims, or her casual revelation that she intends to undo the curse of the Watchmakers and spread Irrationality throughout the Universe again. She invites Chris to try irrationality for himself, and to his surprise he finds that here in the desert he can create gynoids without thinking about it. In fact, he can only create them by not thinking about it...
Roz tries to use the amaranth to restore Reason to her surroundings, but there is too much data for it to handle. Trying to latch onto something, it spawns a duplicate of Roz from the personal ID implant in her wrist -- but this is the old Roz, as she was before she met the Doctor, and she accuses the real Roz of being an alien sympathiser and fugitive from justice and tries to shoot her. The amaranth, vainly trying to stabiliser the entire town, runs out of control and taps into the TARDIS data banks to find out what the town is supposed to be like. History unfolds around them at breakneck speed, and Roz becomes trapped in the amaranth’s attempt to rationalise history -- a giant slave ship, in which Roz the Adjudicator, serving her masters, wields the whip that keeps the slaves in line. Daniel, meanwhile, sees an endless parade of bloodshed, war and assassination, culminating in the creation of the nuclear bomb simply because ordinary people -- the ones who kept their heads down, trying not to be noticed -- did nothing to stop it. He is then contacted by Interface, which is returning to existence as the Doctor reassembles his TARDIS from the controls in Catcher’s cellar, and learns that he is the first natural psychic to be born into the Age of Reason. Humanity is beginning to take responsibility for its own actions, rather than blaming gods or demons -- and if Daniel doesn’t like the future he’s seen, then it’s up to him to make a better one. Accepting his responsibility at last, Daniel tracks down Roz just in time to save her from her other self, and leads her to the Doctor.
Having restored his TARDIS and deleted Catcher’s creation, the Doctor has put an end to the instability which was opening cracks in the rational Universe. He therefore gives Daniel the amaranth and returns him to Woodwicke to put an end to the chaos there, while the Doctor deals with the Carnival Queen, whose return would banish reason and certainty from the Universe forever. Roz has seen history for herself now, and is no longer sure that it’s worth fighting for -- but if the Doctor does not stand up for the cause of reason, then all those who have fought and died alongside him will have died for nothing, their sacrifices rendered meaningless in a Universe without meaning. Catcher is in a state of shock, seeking Reason where there is none to be found, and the Queen’s influence is already spreading beyond Woodwicke, affecting other countries, and other planets -- even Gallifrey, where the President inadvertently releases 300 convicts from a prison asteroid, including Grandfather Paradox, legendary voodoo priest of the House of Lungbarrow.
The Doctor finds Chris in the middle of a gynoid city he created without noticing. It all comes down to Chris now, and his decision will determine the fate of the Universe. What does he really believe in? Order or chaos? The Doctor or the Carnival Queen? A clockwork version of history in which death and war cannot be prevented for fear of upsetting the balance, or an irrational universe where there is no way to predict what will happen next, and no way to be certain what to do in any given situation? Chris finds the answer in his childhood memory of his father foiling the bank robbers. Law and order is in his blood. He chooses Reason; the uncertainty the Carnival Queen offers is too much for him to handle. With his choice, Cacophony is once again confined to its prison outside the rational Universe, and the Doctor takes Chris back to the TARDIS, telling him that he made the right choice -- the same choice the Doctor’s people made, long ago. But as soon as the Doctor is alone he switches off Interface, furious with the TARDIS for what it has done to Chris. The TARDIS is a product of the Time Lords, and the ultimate conception of their rational Universe -- and it telepathically implanted a false memory in Chris’ mind, to prompt him into making the decision which the TARDIS needed in order to survive.
Daniel uses the amaranth to banish the last of the irrationality from Woodwicke. The Doctor returns the recovering Marielle to town, where she finds that Tourette has vanished, Raphael has been changed into a monster by the irrational rain, and that the Shadow Directory has declared Woodwicke unrecoverable -- and announced that any agents within the area are to be “retired”. With nowhere else to go, Marielle joins Daniel, who intends to go to France and seek out others like him. The misshapen Isaac retreats to live in the forest outside town, while Catcher falls into a catatonic stupor into which no irrationality can intrude. The Doctor departs to continue his investigations into the Yemaya incident, but changes the subject when Chris asks how much of what the Carnival Queen told him was the truth. Outside time and space, the Queen watches sadly, knowing the destiny that History has set for Chris -- and knowing that he didn’t make the right choice after all.