On an island off the coast of Europe, workers Jennifer, Buzzer, and Jimmy don acid suits and enter a series of chambers within the island. They make their way to an acid distribution vat and Jennifer confirms that the levels are decreasing. Buzzer gets up on the edge of the vat to examine the machinery and Jennifer accidentally knocks him in. She and Jimmy casually watch as Buzzer starts to dissolve, and Jimmy complains about having to fill out the paperwork on the suit. They walk away and run into Buzzer, who complains that Jennifer knocked him into the acid, but concedes that no one was hurt.
Aboard the TARDIS, Amy and Rory are playing darts while the Doctor covertly scans her and gets the same discrepant readings concerning her pregnancy. He then moves on and suggests that he drop them off for fish and chips while he goes on a separate trip. Amy figures that he's up to something and asks what, but before the Doctor can answer, the TARDIS is swept up in a solar storm. The Doctor manages to regain control of the TARDIS to bring it out of the storm as it strikes Earth, and the vessel materializes on the island next to what appears to be a monastery. The island appears deserted, but they hear Dusty Springfield's music playing on loudspeakers. As they investigate, they find exposed acid pipes leaking into the surrounding ground.
The three travelers enter the monastery and the Doctor comments that he's back, and Amy suspects that he came there deliberately. He assures her that it was an accident, but before Amy can pursue the matter, intruder alerts go off. They run into the main building and find a control chamber with Jennifer, Jimmy, and Buzzer strapped into harnesses and unconscious. Before the Doctor can determine what's going on, Jennifer, Jimmy, and Buzzer come in behind them and take them captive at gunpoint. The workers' leader, Miranda Cleaves, arrives and explains that they're intruding at an alpha-grade industrial 22nd century army facility. Using his psychic paper, the Doctor "proves" that he and his companions are inspectors and warns that a second solar wave is on the way. Cleaves' assistant, Dicken, scans them for contamination while Cleaves explains that she and her people are contractors for the military. The Doctor demands that Cleaves take them to the critical systems.
Cleaves and the others show the Doctor and his companions to a chamber containing a large vat. Inside it is a bubbling white substance which Cleaves explains is Flesh. It can be programmed into any living shape, and duplicates voice, hair, and clothing. Rory realizes that four of the five workers are Flesh doppelgangers, and only Jennifer is a real person. The others are actually in their harnesses, controlling their "Gangers." The Doctor suggests that the Flesh is actually a life form because it grows and develops, but Cleaves dismisses his concern and says that they use the Gangers to check the acid because the leaks are too dangerous for human beings. When a Ganger is killed, the pain receptors to the controlling human shut down automatically and they generate another Ganger in the shape of the human.
Cleaves sends Jennifer to her harness to generate a new Ganger of herself. As they wait, the Doctor uses his sonic screwdriver to check the Flesh and discovers that it is scanning him back. He manages to disconnect his sonic screwdriver and touches the Flesh despite Cleaves' warning. He pulls his hand free and tells Cleaves that it contains all of the workers' thoughts and memories, and that it is alive. The second solar storm hits, cutting off contact with the mainland. With no other orders, Cleaves tells the crew to continue piping acid to the mainland until they receive other orders.
While Jennifer enters her harness and activates the system, Cleaves shows the Doctor and his companions a vat filled with Flesh. When Jennifer activates the system, it downloads her specifics into the Flesh, and it takes her shape, clothes and all. The features are initially only half-formed, but after a few seconds duplicate Jennifer exactly. The Ganger Jennifer emerges from the vat and prepares to go to work, and the Doctor offers to get them all off of the island in the TARDIS. Before they can consider his offer, the alarms go off and the Doctor warns Cleaves that the solar storm will overload the factory's solar power receptors. Cleaves refuses to give up control, and the Doctor takes Rory and Amy with him to the monitoring station to check on the storm. He confirms that the power surge will blow out the factory's power circuits and goes to the monastery's cockerel to stop the overload.
As the Gangers go to the harness control chamber to watch over their human counterparts, the pressure on the system causes more leaks. Some of the acid pools on the ground beneath the TARDIS.
The Doctor climbs to the top of the cockerel and tries to stop the power surges through the primary circuit box, but an electrical surge knocks him out. In the harness control chamber, the power goes out as the Gangers scream in agony, and Amy and Rory are knocked out in the monitoring room.
What seems to be a few minutes later, the Doctor wakes up as the storm dissipates. He finds Cleaves, who admits that he was right. They search for the rest of the crew and the Doctor realizes that they were out much more than a few minutes, and possibly as much an hour. He warns Cleaves that a lot may have happened in that hour.
When they wake up, Amy and Rory go to the control room and make sure that Buzzer, Jimmy, and Dicken are helping each other out of their harnesses. Jennifer is already out of her harness, and she explains that she was trapped in the system when the power surge occurred. Rory holds her as the Doctor and Cleaves arrive. When they notice that the Gangers are gone, Cleaves explains that when the system shuts down, the Gangers revert to undifferentiated Flesh. Before they can locate the Flesh, they hear Dusty Springfield music over the loudspeakers and realize that the Gangers are still functional and at large.
The Doctor and the others go to the dining room and find the record player, and discover that the Gangers have been going through their counterparts' personal belongings. The Doctor deduces that the Gangers are trying to find confirmation of the human memories that they contain, and are trying to reconnect to those lives. Buzzer mentions an apocryphal story of a Ganger that went berserk and killed its human creator. Jimmy points out that Gangers can't remain stable without a connection to their human creator, but the Doctor and Cleaves aren't so sure.
Jennifer complains that she feels ill and goes to the washroom, and Rory accompanies her. She asks him to turn his back for a moment, but then spits up a blob of Flesh. Sobbing, she goes into a stall and Rory hears the noise. As he approaches the stall, an elongated arm smashes through the door and punches him back. The Jennifer Ganger then extends its head out on a stretchable neck and tells Rory to let them live. Startled, he runs for his life.
In the dining room, Jimmy is hesitant to attack the Gangers but feels there's no choice. The Doctor notes that if Jimmy is non-violent, then his Ganger shouldn't be as well. The Doctor then asks Amy what she saw when she returned to the harness control room after the blackout. She explains that when she arrived, Jennifer was already out of her harness. As Amy talks, the Doctor prepares food in the microwave and offers a hot plate to Cleaves. She causally takes it but doesn't realize that it's hot until the Doctor points it out. He explains that the nerve endings in the Flesh haven't fused properly yet, and asks the Cleaves Ganger to trust him. Distracted, her features become half-formed, confirming his accusation, and the Ganger insists that she's real and runs out of the dining hall. Amy realizes that Rory is gone too long and they go to search for him, but discover that acid leaks throughout the compound have cut off many of the hallways.
Jennifer pursues Rory through the monastery. He avoids the acid leaks and hides behind some crates.
The Doctor, Amy, and Jimmy find the hole in the restroom stall, and the Doctor warns them that the Gangers are angry and scared. They realize that the Doctor knows more than he's telling, but he avoids their questions and says that he needs to talk to the Gangers and fix things. After avoiding another acid leak, the Doctor says that it's too dangerous and sends Amy and Jimmy back to the dining hall. He plans to go to the TARDIS and use the scanners to find Jennifer and Rory. Once he goes, Amy insists on secretly following him rather than be left behind. Meanwhile, Buzzer and Dicken go to get acid suits to protect against the leaks.
Rory finally locates the Jennifer Ganger in her human creator's quarters, her features half-formed. She's looking at photos of Jennifer as a child and insists that she remembers everything that happened to her in the past. Rory asks her where the real Jennifer is, but the Ganger says that she is the real Jennifer. She cries and her features stabilize as she asks Rory to help her.
The Doctor goes to the vat chamber and scans the Flesh with his sonic screwdriver. He goes, unaware that a pair of lips have formed in the Flesh substance. They whisper, "Trust me." Meanwhile, the Doctor goes outside to the TARDIS and discovers that it has sunk mostly into the dissolving ground. He accidentally steps into a puddle of acid and abandons them to run into the monastery.
Buzzer and Dicken discover that the Gangers have stolen the acid suits.
The Ganger Cleaves meets with the other Gangers and tells them that now they have the acid suits, they can strike at will against their human counterparts.
Rory and the Jennifer Ganger head back to the others. He refers to her as Jennifer and assures her that the Doctor wants to help the Gangers. As they go, they're unaware that the real Cleaves is watching them and hearing everything Rory has said.
After having lost the Doctor, Amy enters a chamber and sees the Eye Patch Lady watching her through a slot in the wall. The Lady closes the slot and Amy retreats. She finds Rory and the Jennifer Ganger, and Rory insists that they need to help the Gangers. Buzzer and Dicken arrive and realize that they're facing the Jennifer Ganger, but Rory insists that she can be trusted.
The Doctor returns to the vat chamber and finds the four Gangers waiting for him. He convinces them to let him help and they follow him to the dining hall. As they go, the real Cleaves watches them.
The crew takes the Jennifer Ganger to the dining hall and asks her where her human counterpart is. She insists that she is the real Jennifer, while Amy wonders why her husband is siding with the Gangers. Rory says that Jennifer is afraid and needs their help. The Doctor arrives with the other four Gangers and asks for a new pair of shoes.
Muttering to herself about the Doctor's betrayal of the humans to the gangers, Cleaves finds a locker and removes a particular piece of equipment.
The Doctor puts on a new pair of shoes and explains that the storm hardwired the memories and personalities of the humans into their Ganger counterparts. He insists that the Gangers are now alive and that they can't be treated as "accidents" to be disposed of. He offers to get everyone to the mainland and Jimmy says that he wants to see his son. However, the Jimmy Ganger echoes his sentiments and tells his counterpart that he can remember everything he does about their son's birth. The Doctor says that they can work things out once they're back on the mainland, and Jimmy goes to find Cleaves. The Jimmy Ganger offers to help and Jimmy accepts. However, Cleaves arrives and shows them a circuit probe, capable of generating 40,000 volts. She insists on taking control, much to her Ganger counterpart's disgust. The Buzzer Ganger tries to disarm her, but Cleaves fires the circuit probe, stopping its heart. The Doctor tries to revive it without success, and angrily informs Cleaves that the Ganger was alive and Cleaves murdered it. Growing angry, the Jennifer Ganger's features start to melt. Rory struggles with Cleaves while the Gangers flee the dining hall. Cleaves announces that they're at war. Dicken immediately agrees and after a few seconds' hesitation, Jimmy agrees with his boss.
In the vat chamber, the Jennifer Ganger says that now it's them or the human and that they're at war. The Ganger Cleaves is reluctant, but the Jennifer Ganger says that she's going to find her human counterpart and eliminate her. The Ganger Jimmy and Dicken follow her orders and don their acid suits.
Confused, the real Jennifer goes to the Ganger generation chamber and hears someone in the shadows call out to her, saying "Trust me." Frightened, Jennifer runs out of the room.
In the dining hall, the Doctor has Jimmy and Dicken tell him that the chapel is the most secure room in the monastery. As they leave, the Doctor warns Cleaves that the Gangers ill strike back now that she has murdered one of their number.
The three gangers don the acid suits and move through the monastery. Jennifer sees them but before she can pursue, she hears Rory call out to her. She follows his voice, unaware that it's a trap and her Ganger counterpart is ready to ambush her.
The Doctor and the others enter the chapel and hear Jennifer scream. As the others go inside, Rory starts to turn back. The Gangers arrive and he's forced to run down a side corridor. Amy tries to go after him, but the Doctor warns that it's too late, gets her into the chapel, and seals the door behind them. The humans barricade the door while the Doctor realizes that someone else is in the chapel with them. Amy says that they're in danger, and the figure steps out of the shadows and insists that they can work things out. As he steps into the light, they realize that it is a Ganger of the Doctor.