After drifting through space for six days, Sam is rescued from the Kusk ship by another ship which is on its way to Mu Camelopides VI and the Dreamstone Moon. Most of the crew are miners for the Dreamstone Moon Mining Corporation, but one of the passengers -- an alien named Aloisse who helped to rescue Sam -- is on her way to join ecological protestors who believe the miners are exploiting and destroying Dreamstone Moon’s unique vacuum-based ecology. One of the miners, Daniel, advises Sam to sit back and wait for the next ship to leave Dreamstone Moon, but Sam joins the protestors instead and helps them to dig bunkers so they can stage a sit-in and stop the miners from nuking part of the moon in order to build a rubbish dump. But two of the protestors, the spider-like Kekkikks, vanish while screaming about something under the Moon, and when Sam and Aloisse investigate they are attacked by a tentacled monster...
Elsewhere, on the colony Occam’s World, Anton la Serre -- a professional dreamer who is being put out of business by dreamstone -- buys a stone to see what all the fuss is about, but instead of recording and amplifying his dreams it gives him a terrible nightmare and then goes black. When Anton recovers he sees an opportunity to discredit dreamstone and get his old job back, but while seeking “bad dreamstone” he accidentally kills a criminal supplier of the stone. Shaken, he tries his new dreamstones and dreams once again of monsters coming to kill him, and decides to go to Dreamstone Moon to investigate in person.
The Doctor successfully traces Sam to Dreamstone Moon, but when he arrives he learns that security has closed down the site of a recent accident and is refusing to let even the miners in. He’s even more intrigued when he learns that this isn’t the first time something similar has happened, and decides to investigate. With Daniel’s help he bluffs his way past mine security, only to learn that military forces have been called in to deal with the emergency. Something is going on which the company doesn’t want people to know about. The Doctor convinces Daniel’s supervisor, Tiydon, to let him analyse a sample of dreamstone, and what he learns convinces him that the mining should be stopped immediately.
Sam recovers in hospital and learns that Aloisse pulled her to safety. The Kekkikks’ funeral service turns into a propaganda platform for the protestors, and while talking to a reporter, Madge, Sam learns that an Earth fleet has been bombing moons in the vicinity as if preparing for a war. Madge suggests that Sam get away while she still can...
Anton arrives on Dreamstone Moon and meets a wildcat miner, Innell, who recognizes him and agrees to show him raw dreamstone ore. Anton falls under the spell of the ore and dreams of monsters coming to attack him, and when Innell chops free a dreamstone so Anton can see it, a tentacled monster appears and kills her. Anton flees and, exhausted, falls asleep near the dreamstone ore -- and dreams of monsters uprooting his mind.
The moonbase suffers a sudden, unexpected moonquake, and the canteen and the protestors’ habitat are crushed by falling rock. Sam tries to rescue Aloisse but gets Madge killed only to learn that Aloisse wasn’t in need of immediate rescue. The Doctor, meanwhile, tries to help the miners trapped in the canteen, and finds military officers blocking the way, as unknown aliens have been spotted in the canteen and it’s feared that the base is under attack. The Doctor studies the remains of a tentacled alien and finds that its neural connections are made of dreamstone, but before he can do anything Captain Cleomides, who’s in charge of the military forces, places him under arrest. She accuses Daniel of consorting with an alien but eventually releases him, concluding that the Doctor has some sort of telepathic mind-warping ability. She decides to execute the Doctor, but Daniel stops her and the Doctor escapes.
Anton is rescued, but the trawler taking him back to the moonbase is attacked by the tentacled creatures from his nightmares. Sam and her friends also reach the moonbase, where they learn that human civilians are being evacuated -- and aliens, including Aloisse, are being segregated into a “special” holding facility. The Doctor suddenly rushes in, pursued by guards, but before he or Sam can do anything the roof explodes open to space as something attacks the moonbase. Several people die in the subsequent fighting, and Anton and Sam fall into a pit in the surface of the Moon and are herded along a tunnel by the tentacled aliens.
Daniel and Cleomides are rescued from the wreckage of the moonbase by an Earth ship. The Doctor is also taken aboard, but Cleomides ignores his attempts to warn her that dreamstone is part of a living organism and has him locked up while she reports to General Shaiko. Shaiko has already studied the computer records of the battle and reveals that there were no aliens -- the human ships and soldiers inflicted all this damage upon themselves, and Shaiko assumes that this is due to an alien mind-warping device. He orders Cleomides to enlist the Doctor’s help to find the enemy base, which he assumes is on the Dreamstone Moon’s planet, Mu Camelopides VI. If the Doctor deviates from the plan he is to be killed.
Sam and Anton are herded into a giant cave of dreamstone, where Anton realizes that the Moon is a living crystalline entity -- and that the Dreamstone Mining Corporation has been chipping away its brain piece by piece. They are nearly killed when an Earth ship tries to blow up the cavern, but are rescued and taken to a hospital ship -- which is then destroyed by marines shooting at their own living nightmares. Sam and Anton take shelter in a medical pod, which is automatically ejected from the ship when the hull is breached.
The Doctor refuses to help Cleomides unless Aloisse is released unharmed, but it’s too late; she’s already been beaten and blinded by xenophobic human soldiers. As Cleomides’ ship, the Unanimity, approaches Mu Camelopides IV, the Doctor tries to convince her that her first priority should be to evacuate the civilians from the system before more of them are killed. Daniel picks up a distress call from Sam and Anton’s hospital pod and takes a shuttle to rescue them, and soon after he’s gone, the ship is forced down when the planet unexpectedly ejects new “children” from itself -- new dreamstone moons. The Unanimity is damaged and its pilot killed, trapping the Doctor, Aloisse and Cleomides on the planet.
Daniel takes Sam and Anton to the planet, where Anton, who’s finally realized the truth, leaves the ship to communicate with the dreamstone. Unfortunately, he’s forgotten to seal his survival suit properly, and exposure to the planet’s atmosphere causes him to lose consciousness. The Doctor leaves the Unanimity to communicate with the planet, and Cleomides, panicking, crosses to Daniel’s shuttle, tells him the others are dead, and forces him to take off. The Doctor and Aloisse, however, manage to contact Shaiko, who in turn contacts Cleomides; already ashamed by her actions, she admits the truth and advises him to trust the Doctor. Shaiko calls off the attack on the new dreamstone moons while the Doctor communicates with the dreamstone mind of the planet. He soon realizes that the planet isn’t intelligent at all -- Anton is responsible for the destruction here. Anton’s fear, resentment of dreamstone and guilt over the murder on Occam’s World have fed back into the dreamstone’s fear of the humans mining it, resulting in its attack. The Doctor convinces Anton that the danger is past, and Anton dreams himself to death.
Shaiko agrees to suspend mining operations and leave the planet alone. The Doctor goes to collect Sam, but, embarrassed by her feelings for him and ashamed about leaving him alone to die again, she’s already left on the evacuation shuttle to Ha’olam. Hurt and confused, the Doctor invites Aloisse to accompany him, but she refuses and convinces him that Sam still needs him -- she just doesn’t realize it yet.