With the TARDIS having landed in the sea off the eastern coast of England, the Second Doctor, Jamie and Victoria Waterfield investigate a nearby beach, which seems to have an improbably large amount of sea foam as well as major gas pipe marked “Euro Sea Gas”. When the Doctor examines the pipe he thinks he can hear a heartbeat from within but the trio are then shot at from an unseen assailant, who has used a tranquillizer gun on them. When they come to, they are interrogated by Robson, a ruthless and highly-strung gas refiner, who heads a major pumping operation with a network of rigs spanning the North Sea. His assistant is the more amenable Harris, who is deputed to lock the travellers away. It is clear Robson is very unnerved by the deliberate loss of contact with gas drilling Rig D at sea, plus an unexplained drop in the feed line from all the rigs. The Doctor suggests the supposed heartbeat could be a creature inside the pipe, which would account for the drop in pressure; but his further suggestion that the gas flow be suspended while he investigates is taken up by Harris but not by Robson.
At central control Robson is pleased to have re-established contact with the silent rig, but all who watch are unnerved by the eerie calm of a man named Carney on screen, who brushes away the communication loss and explains the emergency crew sent to the rig will be staying there temporarily. With the gas pressure continuing to fall, however, it is clear the emergency continues and Robson becomes increasingly hostile to Harris’ suggestions. Especially when a rig worker and Dutch Government employee called Van Lutyens arrives and also implies the situation is out of control. The Doctor, Jamie and Victoria pick the lock on their cell and make it to the control room too, hiding away while an engineer on control rig called Baxter calls in to let Robson know his men have detected a heartbeat noise in the pipe.
Harris sends his wife, Maggie, to retrieve a file from their quarters which contains details of the pressure drops and when she fetches it she finds some seaweed on it which stings to her touch – then oozes sea foam when she is not looking. She is soon feeling unwell and sends for her husband. He finds her in a bad way, hearing a distinct heartbeat noise pounding through her head. When he leaves to find a doctor, she rises from the bed in zombie fashion and starts to stalk out before regaining her composure. Shortly afterwards two very odd men visit – one tall, one short – and they are both dressed in white suits and caps. Only Mr Oak, the smaller man, speaks and he identifies his companion as Mr Quill. They claim to be maintenance engineers here to repair her faulty cooker. When Maggie Harris tries to flee they overpower her with toxic gas emitted from their mouths.
The Doctor and Jamie rescue Victoria, who has wandered off, from the oxygen room. Someone had deliberately trapped her inside while foam poured through the vents and formed some sort of seaweed creature and she is badly shaken. Van Lutyens and Robson are alerted by the commotion, but the latter dismisses this story as nonsense and maintains the travellers are saboteurs. Van Lutyens, however, believes she was deliberately trapped and recalls the noxious smell in the room by the time they arrived. Robson next hears that the enormous impeller pump that controls the flow of gas along the entire pipeline network has slowed down and become unreliable. Again, he rejects the appeal to shut down the pipes while the breach is investigated, even though without the impeller the gas flow will not be channelled properly and could build to an explosive state. Robson’s answer is to open a release valve, which does provide a temporary solution, but does not solve the falling rate of feed to the receiver stations. The situation takes a turn for the worse when Rig C does not respond to communications calls and then the impeller stops completely, revealing the steady sound of a heartbeat. Robson tries to dismiss the noise as a mechanical fault.
Harris has fetched the Doctor and his friends to take a look at his wife. They find her unconscious, with the stench of the same toxic gas as the oxygen room everywhere. She is made comfortable and Harris heads for the medicentre to arrange his wife’s transfer there. The Doctor bags and confiscates the clump of seaweed in the apartment, which he and his friends take back to the TARDIS and examine under laboratory conditions. The weed itself seems able to emit noxious gas and is clearly alive. It even expands with little prompting, threatening them with more gas, but retreats when Victoria screams at it. The weed is able to feed off natural gas under the sea and convert it to a more noxious version. The Doctor also consults the TARDIS library and shows Victoria a picture of the creature she saw, which is a monster identified by mariners in the North Sea.
Without repair the impeller starts up again and then slows and stops. Van Lutyens insists that Robson takes the matter seriously and shuts down the gas flow, but the controller will hear none of it. The Chief Engineer, an old friend, tries to calm him down, but this just sends Robson over the edge. Robson hides in his quarters, where Mr Oak pumps seaweed into his room. Luckily Harris arrives in time to get him out, but Robson has been exposed to the stuff in large quantities and runs away, clearly in great pain. Harris assumes control of the compound on Van Lutyens’ insistence, and a search is set for Robson.
The Doctor and his friends return to the control room. En route they have been to the Harris’ apartment, which has now been over-run by seaweed and foam. He updates the gasmen on his research but is stunned to hear that Maggie Harris was never moved from her apartment. She has is fact gone to the beach, where she and Robson are entranced by the heartbeat noise. She follows a deep compulsion to wade into the sea, while Robson walks away in a zombified state, making little sense to Harris when he finds him.
Contact has now been lost with Rigs A, C and D; but contact has been made with Megan Jones, Director of Euro Sea Gas, who is coming to investigate the compound in a few hours. Van Lutyens now decides to investigate the impeller shaft himself, but while doing so is taken by the creature in the pipe. The Doctor and Jamie venture into the impeller shaft after Van Lutyens and soon find his torch. Above them, in the impeller room, Oak and Quill reappear and tamper with the operation. The Doctor and Jamie climb back out, having again evaded the weed creature.
Megan Jones and her officious aide Perkins have now arrived at the compound, and she seems to care for little other than the drop in gas production. However, a helicopter report from the silent rigs reveals they have been over-run by seaweed and she is forced to concede that things are badly awry. Robson briefly returns to the control centre in a manic state, which the Doctor ascribes to mind control. Another report now arrives from Baxter in Control Rig, who tells them the rig is being over-run by seaweed before the feed cuts out. All the rigs are soon incommunicado too – a colony of weed creatures is now developing that threatens far more than just gas production. The Doctor surmises that a rig awakened the creature, which has systematically attacked senior people to destabilize the compound, and guesses the seaweed in the Harris’ apartment was intended not for Maggie but her husband Frank. The Doctor also deduces that the reason Victoria was attacked in the oxygen store was because the oxygen supplies were being sabotaged; they could well be deadly to the weed creature and those it controls. This prompts Oak and Quill, who have been watching silently, to slip away and empty the remaining oxygen cylinders. When discovered, the depletion of the oxygen stocks proved there are enemies moving within the compound. Victoria soon identifies Quill and Oak as saboteurs. The latter is knocked out by Jamie, though the former escapes.
Harris has prioritised the capture of Robson, who is found sedate in his room, and Megan Jones demands to see him. He has sunk into a very depressed state and will not be rallied for more than a few brief seconds when he begs his old friend to help him. They leave him and he rests. On awakening, the heartbeat sound returns to his head, stronger than ever, and he heads off. Within minutes, he has found Victoria and taken her hostage. He has now begun to display seaweed through his skin and is well advanced in a transformation. He forces her into a helicopter and flies it out to the sea. Using a communicator, he invites the Doctor to “come to us” if he wants to see Victoria again.
The weed has pumped itself up into the impeller pipe in the impeller room and is soon expanding and throbbing, in the same way the sample in the TARDIS had done. It soon bursts the pipe, flowing everywhere, and starts to fill different rooms. The Doctor is sorry to leave with the compound in crisis, but must travel out to the rig where Victoria has been taken. He commandeers a helicopter and travels with Jamie to the rig where they find Robson now mostly transformed into a weed creature. With the typical bravado of the invader, he says humanity is doomed beneath the weed, and tries to gas the Doctor with his breath. Jamie has meanwhile found Victoria and they all escape on a helicopter, but not before Victoria has again repelled the creature using her screams.
The trio return to the control centre and discover that Mr Quill has been treated for his possession and is now almost completely recovered – thanks to sound vibrations treatment. It is now clear that sound offers the best defence against the weed creature. The Doctor believes the nerve centre of the weed creature on the Control Rig can be challenged using the gas pipeline itself to transmit sound. Loudspeakers are rigged up and Victoria’s screams are recorded for playback and use, all amplified by the Doctor’s technical modifications. With the weed creature in the compound now frothing furiously and expanding its size rapidly, the Doctor switches the apparatus on. The scheme is a success. At the compound and on each of the rigs the seaweed has receded, revealing Robson, Maggie Harris and Van Lutyens amongst the survivors, shaken but alive. It is only a matter of time before the gas production resumes.
Victoria has found the battle with the weed creature totally draining, and determines to leave the TARDIS crew. She is tired of the constant peril. The Harrises welcome her to their home and though the Doctor is stoic, Jamie is clearly upset by her decision. The Doctor and Jamie stay another day to check she is sure and then depart in the TARDIS, leaving Victoria watching them from the beach.