In the private community of Sweetville, Edmund Thursday tells his co-worker Effie to call the police in an hour if he doesn't return. When she worries, Edmund tells Effie that they have to get to the bottom of the strange business going on. He walks away from her and enters a chamber containing the source of a glowing red light. Behind Effie, Mrs. Winifred Gillyflower and several other women enter the hallway and offer their sympathies about the death of Edmund. Effie has no idea what they're talking about, until she hears Edmund scream in absolute agony. The women then advance on Effie, who screams in terror.
Later, Edmund's brother comes up from London to bring his brother's body home for burial. The local coroner, Amos, shows him the body, which is a livid shade of red. Amos says that it's not the first corpse to turn up that way, and that he's taking a risk by showing it to Mr. Thursday because Mrs. Gillyflower doesn't want the information to leak out. Back in London, Mr. Thursday meets with Madame Vastra and Jenny Flint. He explains that his brother was an undercover reporter and was working with Effie to learn the truth about Mrs. Gillyflower's operation. Mr. Thursday explains that he took a photo of his dead brother's eyes to reveal the last thing that he saw. Shocked at what's in the photo, Vastra removes her veil, shocking Mr. Thursday into a faint. Vastra and Jenny then develop more of the photos in their darkroom, and confirm that the last thing that Edmund saw was... the Doctor.
Vastra, Jenny, and Strax take a carriage to Yorkshire and Vastra plans to have Jenny go to one of Gillyflower's recruitment trials. The woman only wants the brightest and most beautiful for her private community. When Jenny goes to the meeting, Mrs. Gillyflower is speaking out on the moral decay of humanity. She say that she knows from personal experience and reveals her daughter, Ada. The older woman claims that her husband blinded Ada in a drunken rage, and invites those who are worthy to join her in the community of Sweetville. Afterward, most of the attendees sign up and Mrs. Gillyflower assures Jenny that she's suitable.
Outside, Vastra tells Strax that once Jenny is inside, she'll simply check out every locked door and advance toward any danger, and inevitably she'll find the Doctor.
The next day at Sweetville, Ada makes her way up from the basement and brings a plate of food to a prison cell. She slides it through the slot and assures the monster inside that she hasn't forgotten it.
Mr. Thursday comes to Madame Vastra's home and presents his card to Strax... and promptly faints when he gets a good look at the Sontaran's face. Once Strax drags him inside, Madame Vastra concludes that he's there to check on the status of their investigation, and she wonders how Jenny is doing.
Jenny stands in line with the other new residents and the person next to her, Abigail, hopes that her teeth don't let her down. Jenny chats with her and Abigail admits that she had a friend move there three months ago... and the woman hasn't contacted her since. As the line moves forward, Jenny pays Abigail a guinea to fake a seizure so that she can slip through a locked door. She makes her way to the central processing plant, only to discover that it contains nothing but gramophones playing the sound of machinery. Several workers go by with containers of red fluid and Jenny follows them.
Vastra goes to see Amos and provides her with some of the crimson fluid that he's extracted from the corpses. Much to her surprise, Vastra realizes that she's seen the symptoms before... 65 million years ago.
Mrs. Gillyflower and Ada are having dinner, and Ada asks if her mother's partner, Mr. Sweet, will ever join them for dinner. Her mother says that Mr. Sweet is feeling tired and then spills some salt. Once she dismisses the servant, she pours some of the salt down her blouse.
Jenny goes to the room where Edmund disappeared. Before she can go inside, she hears a noise from upstairs and makes her way to the cells. She hears something slamming into the cell door and peers in through the feeding slot. A scarlet hand tries to grab her and Jenny backs away, slamming the door shut. She whispers through the door, telling the creature inside to stay calm as she opens the door, and it bangs out a response. Once Jenny is satisfied it won't attack her, she picks the lock on the door. Inside, Jenny is shocked to see that the creature is... the Doctor, his skin a bright red and all but petrified. He's unable to speak and Jenny sees his clothing nearby.
Once she releases him from his manacles, Jenny leads the Doctor out just as Ada comes up via the elevator and goes to the cells. Jenny takes the Doctor into the red hallway and sees a large vat. Above it are Sweetville residents, suspended on a rack. They're lowered into a vat of red fluid and Jenny realizes what happened to the Doctor. He points down the hallway and Jenny leads him away.
Ada approaches the cell door and soon discovers that someone has rescued the Doctor.
The Doctor leads Jenny to a small metal chamber and goes inside. He activates his sonic screwdriver and Jenny closes the door. The light inside turns green and the Doctor jumps out, restored to his normal self. He runs off, saying that he needs to find Clara, tossing off an explanation as he goes.
The TARDIS arrives in Yorkshire in 1893 and the Doctor admits that he's lost again. They hear a woman scream and run to investigate. Another woman has turned up dead and Edmund insists that someone has to listen. The Doctor offers to listen and Edmund explains that Mrs. Gillyflower is a talented engineer and chemist has opened up a match factory. No one who goes there ever returns. They examine the corpse, red like all of the others, and the Doctor points out that the image of the last thing the corpse saw could be captured on the eye if the body's chemical composition was corrupted.
The Doctor analyzes the red substance in the body and discovers that it's an organic poison. He decides that they need to infiltrate Sweetville and soon meet with Mrs. Gillyflower, posing as husband and wife. As she shows them around, Mrs. Gillyflower explains that Sweetville is named in tribute to her silent partner. She then shows them an apartment where the couple is kept suspended in a glass jar. Guards take the Doctor and Clara to the vats and submerge them in the liquid. The survivors become docile and mindless, and the rejects are tossed into the canal. However, Ada discovers that the Doctor has been rejected but somehow survived. She takes him to the cell and locks him up, explaining that only Mr. Sweet can explain and he only talks to Mrs. Gillyflower. Ada plans to keep the Doctor that as her secret, her special monster. Late, Edmund burst into the cell and saw the Doctor just as he died from the process.
The Doctor concludes that Edmund came looking for them and was thrown into a vat of the pure venom. Gillyflower has been using the venom to "preserve" people for the coming apocalypse, and Jenny recites what Mrs. Gillyflower said earlier about judgment raining down on all of them. The Doctor takes an interest in the phrasing, and then runs off to find Clara. Jenny reminds him that Clara is dead, and the Doctor simply says that it's complicated.
Strax takes a carriage to Sweetville but gets lost. As he prepares to execute the horse for failing in its mission, a street urchin, Thomas Thomas offers him directions. Strax pulls the boy up and follows Thomas' directions.
As they look around, the Doctor avoids Jenny's questions about Clara having somehow survived. He looks from apartment to apartment and finds Clara inside another giant bell jar. As Jenny looks on, the Doctor smashes the glass.
Ada cries over the Doctor's discarded manacles and Mrs. Gillyflower finds her daughter in the cell. When she demands an explanation, Ada says that she formed a sentimental attraction with one of the rejects. Mrs. Gillyflower is furious that she's released a reject onto the outside world and realizes that she must accelerate her plans for the Great Work. Ada begs her mother not to deny her a place in the New Eden, and Mrs. Gillyflower says that only perfection is good enough for her and Mr. Sweet.
The Doctor takes Clara to the chamber he was in earlier and tries to reverse the process. The Sweetville guards arrive and Jenny takes out the first two. More advance on her but Strax arrives, firing with a blaster. Vastra arrives behind him and Jenny tells her about Clara. The Doctor avoids explaining and Vastra tells Strax to go outside and calm down. Meanwhile, Clara revives and the Doctor tells Jenny and Vastra that she's not who they think she is.
As they leave, Vastra explains that when her people ruled the Earth, they fought menaces such as the Red Leech. It infested their drinking water and secreted a fatal poison. As the Doctor tries to work out what Mrs. Gillyflower is up to, Clara points out that there are chimneys producing smoke, but there's no working machinery. They go to the factory and discover that Mrs. Gillyflower has built a rocket, and is preparing to launch it into the atmosphere to poison the air. The Doctor, watching, says that he has a plan.
As the Doctor and Clara go upstairs, they find a crying Ada. He takes Ada's hand and she realizes that he's her monster, alive because of her. The Doctor thanks her for saving him and Ada explains that she's not to be chosen. She blames the darkness in her own heart but the Doctor assures her that she's not responsible. He asks who Mr. Sweet is, but Ada insists that she can't betray her mother. The Doctor understands and says that she needs to come with them because there's something she needs to know.
Jenny and Vastra sneak up toward where the red venom is being kept.
The Doctor leads Clara and Ada into Mrs. Gillyflower's quarters, where she has the equipment console ready to launch the rocket. They ask to see Mr. Sweet and Mrs. Gillyflower assures them that he's close. She opens her blouse, revealing the "Mr. Sweet" parasite attached to her chest. As she feeds it, Mrs. Gillyflower explains that she found the parasite in the river where it had grown fat on pollution. When the Doctor warns her that the venom can wipe out the entire planet, Mrs. Gillyflower laughs and goes to the controls.
Strax and Thomas watch from outside as the central tower lights up.
Mrs. Gillyflower admits that the Doctor has forced her to advance the Great Work. The venom will rain down, wiping out most of the population, and she will release her suspended specimens to repopulate the planet. The Doctor asks her about Ada, and Mrs. Gillyflower says that her daughter is of no concern. He points out that the scarring shows that Mrs. Gillyflower experimented on her own daughter to create an anti-toxin to immunize herself. Ada, who has been standing outside, hears the entire thing. She lashes out at her mother with her cane while Clara picks up a chair and destroys the launch mechanism.
Stunned, Mrs. Gillyflower asks Ada to come to her. When she does, Mrs. Gillyflower puts a gun to her head and uses her as a hostage. Once she leaves the room, locking the door behind her, the Doctor smashes the window open. Once outside, they run to the central tower where Mrs. Gillyflower is dragging Ada to the top of the rocket where there's a secondary launch control. Ada manages to pull away and tells her mother to shoot if she wishes because her mother killed her a long time ago. The Doctor pulls Ada away while Mrs. Gillyflower launches the rocket.
As Mrs. Gillyflower laughs in triumph, the Doctor gestures to Vastra and Jenny, who reveal that they have the jar of venom. As she prepares to shoot them all, Strax calls to her from the top of the tower, telling her to put down her gun. Mrs. Gillyflower fires at him and misses, and Strax shoots back, hitting her hand. The woman topples over the railing and falls to the floor fall below. As they run down, they see Mr. Sweet crawling away from the dying woman. Mrs. Gillyflower begs Ada to forgive her and the girl refuses. Satisfied, Mrs. Gillyflower says that's her girl and dies. As they wonder what to do with the parasite, Ada finds it and beats it to death with her cane.
The next day, the Doctor and Clara prepare to return to London in the TARDIS. As Clara goes in, Ada tells the Doctor that she plans to step out of the darkness and into the light. The Doctor kisses her on the cheek and assures her that she'll be splendid. As he says goodbye to the others, Jenny asks about Clara. The Doctor smiles and says that he hasn't explained, and then goes into the TARDIS. Mr. Thursday comes by to see if they've made any progress, sees the TARDIS dematerialize, and faints.
Later, Clara returns to the Maitland home. She discovers that Angie and Augie have been checking the Internet and found photos of Clara aboard the Russian submarine and at Caliburn House. They come in and say that they found the photos at school, and ask if the Doctor is Clara's boyfriend. Angie shows her a photo they found of her in Victorian London, and Clara realizes that it's the wrong place. The kids realize that Clara can travel through time and asks if they can have a go. When Clara refuses, they threaten to tell their father that their nanny is a time traveler.