Hazel McKeown is a single mother with two children, the sullen teenage Jade and the ten-year-old Callum. For the past two weeks, Callum has been suffering from intense night terrors, and they are growing worse. When Callum’s eyes turn jet black in the middle of a nightmare, Hazel calls her family doctor, but, shaken by the inexplicable symptoms, is unable to express herself and fails to convince Dr Green’s receptionist that it’s worth a house call. However, a stranger bearing a doctor’s bag then shows up at the house, and when he hears Callum screaming, he rushes to the boy’s room and breaks down the door to find Callum literally choking himself to death. The Doctor knocks the boy’s hands away from his neck, saving his life. The Doctor assures the exhausted and frightened Hazel that her son’s problems are not psychiatric, but she is not convinced -- particularly when the Doctor examines a picture that Cal drew of a tree and points out that the red “berries” are in fact drops of blood.
Hazel reluctantly allows the Doctor to question Callum, and the Doctor wins the young boy over by pulling candy and comics out of his doctor’s bag, including a brand-new Eagle comic from 50 years ago. Callum tells the Doctor about the horrific images he sees in his dreams, and then falls asleep again, exhausted. The Doctor chastises Hazel for giving Callum sleeping pills, which he claims are weakening his resistance to the malevolent psychic force trying to get a grip on his mind. Realising that she’s let a lunatic into her home, Hazel tries to kick the Doctor out, but Callum sleepwalks down the stairs after them, blood pouring from his nose and mouth. Shaken, Hazel allows the Doctor to tend to him, and the Doctor explains that Callum is suffering from soft tissue trauma caused by a build-up of psychic pressure, which the Doctor has seen before on the planet Kufan. Jade is woken by the commotion, and when she mentions that she caught Cal at Old Man Crawley’s cottage, listening to the recluse’s ghost stories, the relieved Hazel grasps at this rational explanation for Callum’s nightmares. She sends her children back to bed, orders Callum never to go near Crawley’s house again, and politely but firmly ushers the Doctor out of her house. However, though she tries to deny it, some part of her understands that Callum is suffering from something far more extraordinary than mere nightmares...
The next morning, Jade’s schoolteacher, Bernard Harris, meets Fitz and Trix while jogging through the woods. The Doctor’s companions have been looking for ghosts in the reputedly haunted woods, and though Harris claims not to believe the local legends, he does show Fitz and Trix to a nearby memorial stone. The Doctor then arrives, and Harris slips away while the Doctor cleans away the moss to reveal the word “Deadstone” carved into the memorial. Trix and Fitz return to the TARDIS to rest while the Doctor scouts around with a psionic field detector, looking for the source of the disturbance that the TARDIS detected when it materialised in the woods. While doing so, he runs into a scruffy young man named Lewis, who claims that his uncle Tommo went mad after seeing something terrible near the memorial. Lewis reluctantly takes the Doctor to the caravan he shares with his uncle, but the hostile Tommo drives the Doctor away at gunpoint, refusing to relive his “hateful memory” and terrified that the Doctor is going to dig up things best left alone.
On their way home from school, Jade and Callum see the Doctor fleeing Old Man Crawley’s house steps ahead of Crawley’s pit bull, Milton. The Doctor stuns the hostile dog with his sonic screwdriver, and decides to visit Crawley some other time. Jade convinces the Doctor to walk Callum home while she visits a friend; when Hazel returns home to find the Doctor cooking baked salmon in her kitchen, she threatens to call the police, but realises that it would do no good when the Doctor pays more attention to his boiling parsley sauce than to her threat. Fitz and Trix join them for dinner, and the Doctor warns Hazel that Callum’s problem is only going to get worse unless she allows him and his friends to investigate. She reluctantly agrees to let him try, on the condition that she can stop him at any time if she fears he’s making Callum’s condition worse.
Jade returns home after dinner, and when Fitz pops outside for a smoke, the Doctor joins him for a chat. Fitz wonders why they’re bothering with such a small problem as opposed to the cosmic threats they usually confront, but the Doctor suspects that Fitz has become accustomed to travel in the TARDIS and is afraid he’ll find a reason to stay if he returns to Earth. When Hazel leaves the house to get some fresh air, the enthusiastic Doctor convinces her to climb up onto the roof of her house and wave at the stars; to her amazement, she finds herself doing so. Meanwhile, Callum is drawing pictures with a multi-coloured magic pen provided by the Doctor; at his prompting, Trix draws a picture of her “home,” the TARDIS. Callum then has a panic attack, and Trix calls the Doctor and Hazel in when the boy begins to climb the walls, screaming that the floor is crawling with rats. The Doctor manages to calm him down, but realises that the malign influence is now strong enough to give him nightmares while he’s still awake. He orders Trix to remain and keep an eye on Callum while he and Fitz check the Deadstone memorial.
As the Doctor and Fitz walk through the woods, the Doctor, in the mood for a ghost story, tells Fitz that someone has been making moves on the chessboard in the TARDIS console room. Recently, the Doctor happened into the console room late at night and saw a white-haired old man with the face of a skull making a move. The Doctor never saw him again, but his opponent won the game. As the Doctor tells the story, he and Fitz are surrounded by a deathly cold mist, and they catch sight of a figure flitting through the woods towards the memorial. There, insects are crawling out of the ground as if trying to escape from something, and as the Doctor investigates, the mist flows up the sides of the memorial and takes the form of a ghostly humanoid figure. The ghost attacks the Doctor, who reverses the polarity of his psionic field detector, driving off the ghost; however, the detector then burns out, and the Doctor and Fitz decide to retreat.
Jade has gone to bed, still failing to appreciate the seriousness of the situation. Hazel admits to Trix that Jade still blames Callum’s birth for the end of her parents’ marriage; Hazel doesn’t have the heart to spoil Jade’s fond memories of her father by telling her what he was really like, and fears that if she tries to do so, this will drive even more of a wedge between herself and her daughter. Callum then begins convulsing, speaks of a dead man walking through the woods, and coughs up a thick, green foam. As Hazel and Trix tend to him, the Doctor and Fitz return, claiming to have seen a ghost -- or rather, an ectoplasmic life form. A hostile psychic force is emanating from the memorial stone, and it’s growing stronger. The Doctor sends the others to sleep and sits up with the shaken Hazel; despite her cynical front, he realises that she’s at heart a disappointed dreamer who’s been proven wrong too often, and he assures her that it’s all right to believe in wonders.
The next day, Hazel calls in sick and stays home with Cal, but sends the irritated Jade off to school. In the meantime, the Doctor, Fitz and Trix visit Old Man Crawley’s. This time, there’s no sign of his dog, and the Doctor breaks in to find that the house is a filthy, rat-infested hovel. In the cellar, he and Trix find a pile of small animal bones, and the Doctor senses something like a dream on the edge of his mind. After a moment’s concentration, he rushes out of the house back to the TARDIS, telling his companions that he’s trying to keep a thought in his head, like trying to remember a dream after waking; the difference is, it’s someone else’s dream.
On the way back to the TARDIS, Fitz sees Harris returning home for his lunch break, but senses something furtive about his behaviour and decides to follow him. While snooping about, Fitz finds a transparent alien ghost lying on a table in Harris’ garage. Harris catches him, and admits that he found the “ghost” while out jogging. Fearing that Fitz and his fellow ghost-hunters will take the strange thing from him, Harris tries to stop Fitz from leaving, and while trying to get past him, Fitz slips on a patch of oil and knocks himself out. Frightened, Harris ties Fitz up and leaves him in the garage until he can decide what to do about him. He then returns to school, where he is shaken when Jade vents to him about the weirdos who have seemingly taken over her home. Harris impulsively tells Jade that the Doctor and his friends are working with Old Man Crawley to frighten Cal and prey on her mother’s vulnerability, and warns Jade not to trust them.
Trix escorts the increasingly disorientated Doctor back to the TARDIS, where he connects himself to the telepathic circuits and orders Trix to press a large button marked “Do Not Touch” on the console. He then collapses in a nearby chair, apparently asleep, but disappears while Trix’s back is turned. While waiting for him to return, Trix impulsively calls and leaves phone messages for her mother and Anji, affected by a strange sense of anticipation, as if the TARDIS itself expects important changes in the future. Meanwhile, the Doctor finds himself walking down a corridor in the TARDIS, towards a mirror in which he sees alternately himself and a man with a goatee and hypnotic stare. The Doctor’s head then splits open, and a rat crawls out. Soon afterwards, Trix is startled when the transparent form of the Doctor emerges from the lifts, but as he draws closer to her, he becomes more solid and corporeal. He spouts off random memories as he recovers, trying to anchor himself to reality, and explains that the psionic field he tuned into was so powerful that it actually phased him out of existence. However, now the telepathic circuits have calculated its psionic frequency, and the Doctor can begin to fight back.
The Doctor and Trix return to the McKeown household, where the Doctor tells Hazel that he found a psionic blister in Old Man Crawley’s cellar and made contact with an entity that he believes is desperate to free itself. However, he also fears that he’s put it on guard, and that it may react to any further probing with deadly force. The Doctor thus builds a makeshift psionic shield for Cal out of a metal colander, wires from a CD player, AA batteries and pieces of the TARDIS telepathic circuit; this will help keep the force out of Cal’s mind while the Doctor investigates. First, however, the Doctor intends to track down the missing Fitz.
Jade, disgusted by her mother’s apparent gullibility, decides to visit Old Man Crawley’s cottage herself and prove that there’s nothing there. On her way, she runs into Harris, who has been walking the streets, wracked with guilt and trying to decide what to do about Fitz. Harris follows Jade to Crawley’s cottage, trying to discourage her from breaking in, but fails and reluctantly accompanies her to the cellar to keep her out of trouble. They are trapped in the cellar when the door slams shut behind them, and Jade then begins to convulse as she too encounters the psionic blister. Back in the McKeown house, Cal also begins to convulse at the same time as his sister, and Hazel finds herself helpless to protect her son from the intangible forces attacking his mind.
Fitz has regained consciousness, but as he tries to free himself from his bonds, the ghost suddenly revives and attacks him. The Doctor and Trix burst in at the last moment, but the ectoplasmic creature ignores the Doctor’s attempts to communicate and flees into the woods, breaking Fitz’s wrist on the way past. The Doctor hypnotises Fitz to block out the pain and chases the ghost to the Deadstone memorial, where Old Man Crawley and Milton are waiting. The Doctor calms down the pit bull by tossing it a biscuit, but Crawley, putting on a menacing air, tells the travellers of the evil children who were buried alive in these woods. The travellers realise that they can hear screams and scratching from underground, but when they look up, Crawley and his dog have gone, and the Doctor dismisses the story as a mere distraction. When he examines the monument, he finds that the moss has been scraped away to reveal more of the inscription: “In Hateful Memory, Henry Deadstone.”
The Doctor takes Fitz back to the TARDIS to treat his broken wrist. Hazel and Cal then arrive, having tracked down the TARDIS from the drawing Trix made for Cal. Hazel tells the Doctor that Jade has gone missing, but, shaken by her sight of the TARDIS interior, agrees to leave matters in the Doctor’s hands. While Fitz escorts Hazel and Cal back home, the Doctor takes Trix to confront Tommo again, convinced that he can tell the Doctor more about the memorial. The Doctor manages to overpower Tommo and take the shells from his shotgun, and Trix manages to convince him that his story might be all that can help them save a missing girl. Tommo, subdued, tells the Doctor and Trix about Henry Deadstone, who is said to have fed children to the Devil; when he took a Gypsy girl, the Gypsies took the law into their own hands, hanged him from the Old Tree and buried him beneath it. However, the Old Tree died shortly thereafter, and ever since it’s said that the woods have been haunted. Some years ago, Tommo tried to frighten Lewis into obeying him by taking him to the memorial -- but the ground gave way beneath him, and what Tommo saw then has haunted him ever since. Traumatised even by the retelling of his story, Tommo attacks the Doctor, who is forced to knock him out in self-defence and then retreat with Trix from the furious Lewis.
As Fitz escorts Hazel and Callum back home, Cal realises that he can sense his sister’s presence nearby. Fitz theorises that Jade has come into contact with the psionic blister in Crawley’s cellar, forming a psychic link with her brother; however, when they visit Crawley’s cottage, they find it apparently deserted, and retreat, frustrated. In fact, Crawley has been sitting inside, waiting for them to leave, and once they do so, he opens up the cellar to taunt the captive Harris and Jade. Milton attacks Harris, savaging his arm, but though Crawley calls the dog off, he refuses to let his captives go, and locks them up again as Jade begins to suffer another fit. Harris is unable to help Jade, and rats then begin to crawl into the cellar, apparently attracted by the scent of Harris’ blood.
When Tommo recovers, he plans to hunt down and shoot the Doctor to stop him from disturbing the memorial, but Lewis realises that his uncle is in no state to go out and takes the shotgun, offering to deal with the Doctor himself. Lewis catches up to the Doctor and Trix to the memorial, but the Doctor knows that Lewis is unwilling to carry out his threat and manages to convince him that they must face whatever Tommo encountered in order to stop it. Lewis reluctantly admits that he boarded up the pit after Tommo’s experience, and even more reluctantly helps the Doctor to dig it up again. He and the Doctor descend into the pit beneath the memorial while Trix stands guard, but Old Man Crawley surprises and overpowers her, and covers up the pit once again, trapping the Doctor and Lewis inside. He then drags Trix back to his cottage, but they encounter the ghost on the way, and Crawley flees in terror, leaving Trix to face the ghost alone.
In the pit, a grotesque figure begins to emerge from the wall, and when the terrified Lewis shoots the creature, it is revealed to be a composite of the soil, mud and roots that make up the pit. Rats pour out of the shadows, fleeing from the creature in the wall, and the Doctor urges Lewis to follow them. They thus find a tunnel leading to a secret door in Old Man Crawley’s cellar, and are reunited with Harris and Jade. The Doctor’s sonic screwdriver has mud in it, and he thus returns the shotgun shells he took earlier so Lewis can blast open the cellar door. Before he can do so, Crawley opens the door himself -- and before the Doctor can react, the panic-stricken Lewis shoots Crawley in the chest, drops the gun and flees. Crawley’s wounds heal themselves within seconds, and the old man then sets Milton on Harris again. The Doctor threatens to shoot Milton unless Crawley calls him off, and Crawley does so. As the Doctor’s friends flee, however, Crawley realises that the Doctor was bluffing; he would never have shot the dog in any case, even if the gun hadn’t been out of ammunition.
Fitz and Hazel manage to get Callum home and fit the Doctor’s colander helmet over his head, but Hazel grows more and more frustrated by her inability to do anything for her son. Eventually, she decides to call in the proper authorities, and in a fit of anger she removes Callum’s helmet -- causing Callum to go into spasms. Hazel tries to call for help, but she is unable to describe her son’s symptoms convincingly to the hospital or to convince the police to file a missing persons report on Jade, who has been gone for less than 24 hours. The Doctor then returns with Harris and Jade, but Jade suffers another fit and flees from the house, and the Doctor loses her when he chases her out into the road and is struck by a car.
The Doctor returns to the house and explains to Hazel that Crawley must have planted a psychic node in Callum’s head while telling him ghost stories. Having identified the problem, the Doctor reaches into Callum’s mind and pulls out the node, finally freeing him from the terrors of the past few weeks. The Doctor believes that Callum’s psychic link with his sister has enabled the Doctor to cure her as well; however, the psychic node is now inside the Doctor’s head, and unless he can get rid of it soon, the psychic force from the pit will literally tear him apart. He and his allies, including Harris, return to the Deadstone memorial, where they find that Crawley has captured the confused Jade and intends to sacrifice her, rather than her brother, to the thing in the pit. By now, the Doctor has deduced the truth: Crawley is Henry Deadstone, the man hanged by the Gypsies centuries ago.
The ground opens up, swallowing both Crawley and Jade, and Hazel leaps into the pit moments before it closes up behind them. The Doctor, Fitz, Harris and Callum rush to the other entrance in Crawley’s cellar, but when they enter the cottage, Milton attacks Harris once again. The Doctor subdues the dog with his sonic screwdriver while Fitz ties him up, but thousands of rats then swarm out of the cellar, fleeing from the thing in the pit. The Doctor unties Milton, and Harris reluctantly helps to fight off the rats, saving the dog’s life. At the last moment, the ghost arrives at the cottage along with Trix, and generates a psychic pulse that incapacitates the rats; however, at the Doctor’s urging, it stops generating the pulse and leaves the rats stunned but alive. Callum then rushes through the door into the pit, looking for his mother; the Doctor follows him, and the ghost follows the Doctor. Trix explains that she followed the ghost here after it ignored her in the woods, and Fitz deduces that it’s homing in on the psychic energy that is now inside the Doctor’s head.
Callum arrives in the pit, where Crawley prepares to feed both him and Jade to the soil creature as Hazel watches helplessly. At the last moment, however, the Doctor arrives and confronts Crawley -- or rather, Deadstone -- who admits that he encountered the creature centuries ago in these very woods. At first, he was terrified of what he’d encountered and buried it in a pit, but it shared a part of itself with him, extending his natural life. In exchange, Crawley has been feeding it animals and children to keep it alive. However, the Doctor reveals that the soil creature is just half of an alien force that was split in two when it crashed into this dimension. Its ectoplasmic body has been searching for its psychic energy for centuries, while the disembodied psychic energy, traumatised and confused, has tried to build a new body out of the soil in which it was buried.
Hazel attacks the soil creature, trying to save her children, but the creature tears itself free of the wall, attacks the Doctor and pulls the psychic node out of his head. Before it can turn on Hazel and the children, the ghost enters the creature and tries to merge with it, but the traumatised soil creature fights off its other half and claws its way out of the pit. Crawley realises that the creature never really needed him, and as it abandons him, the centuries catch up and he ages to dust within seconds. The ectoplasm reforms, but the Doctor realises that it’s too weak to merge with its psychic half alone -- and he’s too weak to give it the help it needs. To put things right, he needs the help of the children, who have already been touched by the psychic force. Despite Hazel’s objections, Callum and Jade accept the responsibility, knowing that all their suffering will have been for nothing if they don’t help the creature to escape.
Trix and Harris have gone to Lewis and Tommo for help, and Trix finally manages to convince Tommo that the monster will come for him unless he faces it and stops it now. They track down the disoriented soil creature as it crawls through the woods, and Lewis and Tommo open fire on it; their bullets have little effect on the creature, but they do manage to delay it long enough for the Doctor, Jade and Callum to track it down. The Doctor and the children have absorbed the ectoplasm, and they now focus it upon the soil beast -- but as it tries to fight them off, the Doctor and the children begin to fade away into thin air. Hazel rushes forward to help them, and moments later the soil creature collapses into dust -- and the Doctor, Hazel and the children vanish. Fitz theorises that the alien creature has returned to its proper dimension, and that the others were drawn along with it.
Lewis and Tommo return home, Harris leaves to have his injuries seen to, and Fitz and Trix wait for the Doctor to return -- but only Hazel and her children reappear in the clearing. The alien has returned home, reunited and finally at peace -- but in order for the McKeowns to return to their home, the Doctor had to remain in the alien dimension to maintain the psychic link, despite Hazel and the children’s protests. Three days pass with no sign of the Doctor, but just as Trix and Fitz are about to resign themselves to finding lives without the Doctor, he unexpectedly walks out of the woods. He does not explain exactly how he returned, telling them only that Hazel brought him back. Hazel has dreamed of the Doctor, and when she wakes to find that the police box has disappeared, she isn’t entirely surprised. Tommo and Lewis are preparing to move on, as Tommo has finally come to terms with what happened to him; and Harris has, somewhat reluctantly, adopted Milton, who seems to have imprinted on him as his new master. The McKeowns’ life returns to normal, but their family bond is stronger now, and Hazel’s sense of wonder has been restored.