The Doctor is washed up — literally — on an alien beach with only intelligent crabs and a madman for company.
How can he possibly rescue Peri who was lost at sea the same time as he and the TARDIS? But Peri has problems of her own. “Rescued” from drowning by an intelligent sponge growth, she has been adopted by the life form as its own personal God.
As the denizens of the beach come under increasingly vicious attack, The Doctor must discover the truth in time to save all their lives.
The TARDIS lands on a derelict ship in an ocean that covers most of the planet’s surface. Peri decides to go scuba diving while The Doctor goes fishing, but while Peri is on the sea-bed the derelict explodes, apparently sending the TARDIS and The Doctor to the ocean floor. Unable to locate any trace of her friend or the TARDIS, Peri is forced to start swimming when the air in her tanks runs out — but there’s no sign of land in any direction, and inevitably she tires and sinks. She is “rescued” from drowning by a sponge-like organism which forms a mental link with her and begins to eat away her body. Unable to deal with the pain, she retreats into her own memories, even the ones she wanted to forget: her torture on Varos; her new father figure changing his appearance and personality and assaulting her; the lascivious attentions of the evil Sharaz Jek; her childhood sexual abuse at the hands of her stepfather Howard… She realises too late that the thing which is eating her is also sifting through all of her most private memories, her hidden scars. Her only means of escape seems to be to give in to communion with the sponge creature and become the goddess of the marine life which is connected to it, but she refuses to surrender her sense of self and struggles to maintain a grasp of her own identity even as the sponge attempts to eat that away.
The Doctor has been rescued by a crab-like creature and taken to a beach on a nearby island, where he meets a community of genetically and technologically enhanced crab creatures and their human friend, Ranger. The Doctor soon determines that Ranger is suffering from post-traumatic stress disorder, but his efforts to learn more about the war which Ranger was fighting drive the man more deeply into his mental shell. The Doctor theorises that two rival corporations fought over the planet’s resources, but withdrew when the costs exceeded the potential profit. He also concludes that the “crabs” were genetically engineered and technologically augmented for use as soldiers. Ranger has a mental link with the crabs, shared through “the Memory” which used to give the crabs orders during the war, but he doesn’t want to talk about it — and in any case, the Memory fell silent after the corporations withdrew.
Shortly after The Doctor’s arrival, Ranger is attacked by a monstrous “crab”, larger than any of the others on the beach, and his arm is seriously injured before The Doctor’s arrival drives the creature off. Ranger, shaken by the attack, nicknames his attacker “Meathook”. The next morning, The Doctor finds the shattered remains of the crab Snapdragon scattered about the beach. It appears that the beach community has come under attack, and The Doctor, feeling some responsibility for the crabs which rescued him from drowning — and needing help to recover the TARDIS — organises them to construct a boat with which to evacuate the island. He also sends the crab Scrounger to sift through the many wrecks on the ocean floor, looking for medical equipment with which to tend to Ranger’s wounds. Over the next few days, however, more of the crabs turn up dead, their cybernetic shells cracked open and the meat within scooped out and presumably eaten.
While searching one of the underwater wrecks, Scrounger falls foul of Meathook, who pursues him through the wreckage. Scrounger manages to cut his way out of the ship, but runs into another army of crabs outside — Meathook’s followers. Scrounger fights his way past them and heads back to the beach, pursued by the enemy.
Peri continues to fight the entity which is consuming her mind, and finds that she can perceive things through its senses; she can sense the marine life eating away the sponge’s body, and she can remember a confrontation between three POWs and an intelligence officer who informed them they’d been selected for a special experiment. From this memory, Peri realises that the sponge organism is a tool constructed by men, and when she searches through its memory she discovers that she can grow a new body for herself — an offshoot of an experiment which was never seen through to its conclusion. She creates a new female humanoid body, imbues it with a spark of her intelligence, and sends the woman out to find The Doctor, whom Peri has seen through the perceptions of the marine life mentally connected to the sponge growth.
The woman’s arrival causes confusion at the beach. Ranger reacts violently to her arrival and drives her off with an abandoned rifle; he claims to be protecting his property, but The Doctor realises that he just doesn’t want to talk to any other survivors of the war. Frustrated, The Doctor takes the crabs out to search the island, leaving the crab Thinktank back at the beach to keep an eye on the deteriorating Ranger. As the crabs enter the depths of the island’s forest they encounter the native primates, and The Doctor is puzzled by their numbers; with no natural predators the population should be much larger, unless the war was more devastating than he imagined. However, he soon has a more immediate concern, as he and the crabs find the woman’s camp abandoned, a rifle which they’d found and buried earlier has gone missing, and the sound of gunfire is coming from the beach.
Scrounger returns to the beach only to run into the woman, who responds to him with instinctive fear and attacks him. Their fight is interrupted when Meathook’s army arrives and storms the beach. As the woman drives off the attackers with her rifle, The Doctor returns with the other crabs, but he soon realises that they can’t hope to defend the beach against this onslaught. While the crabs delay the attackers as best as they can, The Doctor sets off to collect Ranger. But when he enters Ranger’s cave for the first time, he finds the shell-shocked veteran sitting amidst the hollowed-out shells of the dead crabs, including Thinktank. It isn’t Meathook who’s been preying on the crabs, but their own traumatised friend.
The crab Dozer sacrifices himself trying to destroy Meathook with a buried mine, but Meathook’s followers shield their leader and the massive crab is only stunned by the blast. However, it is disoriented long enough for the survivors of the beach community to escape on The Doctor’s raft. As they flee, the woman tries to speak with The Doctor, but she is literally only a few days old and finds it difficult to communicate. However, The Doctor grasps that she’s speaking of the Memory, and despite Ranger’s evident trauma, he allows the woman to guide them to the Memory — a gigantic sponge-like organism which was grown and used as a base of operations by one of the armies in the war. The woman guides them through organic tunnels to a chamber where The Doctor sees a disembodied brain linked to the Memory’s walls… and surrounded by Peri’s abandoned scuba gear. This is all that’s left of his companion.
Stunned, The Doctor pulls himself together and deduces that Ranger’s link with the crabs means he must have an organic connection to the Memory. He discovers an extrusion on Ranger’s skull and links himself into the Memory through it. The traumatised Peri begs him to help, but she’s going to have to wait, as Meathook and its army are attacking the Memory. The Doctor sends Scrounger and the others to hold off the assault while he tries to learn about the Memory and help his friends. He soon realises that the Memory is also suffering from trauma; when its creators withdrew from the planet, the marine life began to feed on the abandoned Memory, both damaging the Memory and forming mental links with it. It reached out for Peri in desperation, seeking an identity to hold itself together.
The Doctor also taps into Ranger’s buried memories, and learns that he was wounded on active duty and reassigned to the intelligence division. He participated in the initial experiments in which the brains of the planet’s primates were transferred into technologically enhanced crab-like shells, with organic connections to the Memory to turn them into soldiers. When the first phase proved successful, the corporation began to do the same to POWs. Ranger, already unnerved, snapped when his own sister Kirst was brought in for conversion, having made an error which cost lives and valuable equipment in the field. Despite his breakdown he realised that he would be terminated to prevent him from babbling about these top-secret experiments, and he thus escaped and hid on the beach — only to be abandoned when the corporations pulled out.
Scrounger and his fellows try to fight off Meathook and his army, but Meathook fights past them and kills the woman, causing Peri to feel the pain of her “offspring”’s death. Meathook then makes its way to The Doctor and attempts to kill him, perceiving his connection to the Memory as a threat — but Ranger, who wants an end to his suffering and perhaps restitution, pulls the pin from a grenade and throws himself atop Meathook, killing himself… and what’s left of his sister.
The Doctor uses his connection to the Memory to piece Peri’s mind back together and grow her a new body, but he resists the overwhelming temptation to “fix” her and restores her just as she was, scars and all. The work takes several days, but soon Peri is as good as new — or as bad as old. Meathook’s now-leaderless crabs join Scrounger and the others, and before leaving, The Doctor advises them to let the Memory heal; once it has done so, it will prove to be a valuable resource to their community. He leaves the crabs to create their own society, but Scrounger wants to know about his past before he heads into the future. The memories are still buried in Ranger’s brain, and perhaps Scrounger can find them if he eats deeply enough.