Gwen detects a strange energy signal repeating off the coastline of Monknash for ten minutes every morning at 2:00 am. She, Jack, and Ianto head out to investigate, but Jack takes a wrong turning and is forced to speed the SUV down the side of a cliff to reach the beach on time. They arrive just as the signal cuts out, but find a body lying face-down in the surf; the dead man is dressed like a sailor from the 1940s, and his body is covered in hundreds of tiny cuts. The team takes the body back to the Hub to conduct an autopsy, unaware that they were not alone on the beach; the Reverend Neil Hayward of the Holy Church of St Francis in Penarth was lurking nearby, watching everything. Careful to wear black gloves at all times, Hayward places a flask on the beach where the body had been, waits for it to fill up, and then takes it back to his church and pours its contents into the baptismal font. The water moves by itself, settling into the font and then falling dormant.
Rhys wakes up with a pounding hangover after his friend Matt's stag party to find that Matt didn't come home with him last night. Another of Rhys's friends, Paul, provides photographic evidence that Matt left the party with a woman who definitely isn't his fiancée Claire. Matt is supposed to be meeting Claire for lunch, and Rhys, who was in charge of getting him there, now has no idea where he is. Concerned, he calls Gwen to ask for help, but she calms him down and reminds him to check Matt's mother's house before he begins to panic.
Matt's mother, Muriel Thomas, is attending a service at St Francis. Rev Hayward delivers a sermon claiming that God has given them a gift, a way to return to a world without sin. Muriel doesn't take the sermon that seriously, but volunteers to undergo re-baptism, as she wants to get out early so she can meet Claire's mother to discuss the seating plans at the wedding. Hayward instructs Muriel to lean over the baptismal font and think of everything that makes her sad and guilty; he then drips water over her forehead, and the grief and despair hit her like a blow. She relives the pain of losing her firstborn baby when she was 17, and her unspoken fear that Matt is responsible for a drunk-driving hit-and-run accident. She passes out, but wakes with an overwhelming sense of relief, feeling cleansed of all sin. The water in the baptismal font is now churning on its own, as if it's taken the pain out of her and into itself. Rev Hayward privately feels contemptuous towards his elderly flock as they clamour to be re-baptised; personally, he wishes for younger and more energetic followers who will go out from this church to change the world. Muriel then offers to bring in her son Matt to receive the blessing as well, and Hayward concludes that his prayers have been answered.
Gwen conducts an autopsy on the sailor, who died in his mid to late 20s. Despite its clothing, the body does not appear to have suffered 60 years' worth of water damage, but the flesh is riddled with tiny holes that go all the way into the muscle and bone. Gwen extracts a small cocoon from one of the holes, and Jack cuts it open with an alien scalpel to reveal a living, translucent creature like a tiny shrimp. Ianto and Jack take a bioscan of the creature and return to the beach to look for more, while Gwen completes the autopsy and tries to identify the dead man. She eventually finds him listed in the Royal Navy's database as Ron Arnold, who was born in 1921 and disappeared at sea in 1946. Before she can investigate further, however, Rhys calls her up in a panic to tell her that Matt's mother is dead.
Ianto surprises Jack by field-testing the SUV's emergency rocket boosters once they're clear of the city traffic. In the fields near Monknash, they encounter a farmer whose bees all vanished early this morning. The farmer also shows them the body of a sheep; it's been lying dead near the stream for some time, but there are no flies or maggots around the corpse. The SUV's biometric scanners confirm that there are no insects within a kilometre of the beach, but while the obvious conclusion would seem to be that the alien life forms scared them all off, there are no shrimp creatures around the beach either. Ianto decides to get some readings from further out to sea, but the SUV's hovercraft setting doesn't work nearly as well as the rocket boosters, and he and Jack end up stuck six metres out when the SUV stops floating and sinks to the bottom.
Gwen arrives at Muriel Thomas's house to find that she's died in agony -- and that her body is in the same condition as the dead sailor's. She manages to calm the stricken Rhys and explains the situation to him; it's now more important than ever that they find Matt, in order to find out what the connection is between his mother and the dead man. Rhys admits that he's been too embarrassed to call Claire, and Gwen offers to do so in the hopes that Matt eventually got in touch with her himself. Before they can meet up with her, they must first head out to Monknash to give Ianto and Jack a lift back to the Hub while the farmer pulls the SUV out of the sea with his tractor. Jack assures Rhys that they'll stop whatever is happening, and Rhys admits to himself that he trusts Jack to do so.
Matt has gone to St Francis without his mother, aware only that she was feeling ill when he left her. He confesses to Rev Hayward that he's cheated on his fiancée, and Hayward, secretly delighted to have met someone with sins worth forgiving, agrees to re-baptise him. If Hayward can cleanse such deeply rooted sins, then perhaps the young and healthy will flock to his church and go out to make a real difference in the world. Matt dips his head into the font, thinking about how he's only marrying Claire because he doesn't want to disappoint anyone, and how he doesn't want to give up his life of hedonism even though he knows it's hurting the ones he loves. He blacks out as soon as his head touches the water, and Hayward is pleased to find pinprick marks in his scalp. When Matt awakens, he feels cleansed of guilt and stronger than he's ever felt before, and he vows to have his marriage at the church after all so that Claire can receive the same blessing. Hayward is proud of what he's done, and hopes that Matt will last long enough to spread the word before he begins to suffer as the others have.
Jack and Ianto discover that the shrimp creature they left at the Hub has grown over six times larger in their absence. It appears to have a rudimentary digestive system but no mouth, and it's trying to get out of its case, as if it can sense their presence. Jack decides to run a few tests using a stray cat he's named Pusska; he accidentally zapped it with an alien mind control device recently, and it's been hanging around Roald Dahl Plass ever since. Ianto uses the water tower controls to drive Pusska onto the invisible lift, but unfortunately drops the cat onto his head. The shrimp creature takes no interest in Pusska until Jack begins to lower the cat into the box; when the cat lashes out at the strange alien creature, it sheds its shell and emerges as an adult imago with eyes, wings, and fierce mandibles protected by sharp claws. Jack tries to close the lid on the creature, but a mandible brushes against his finger as he does so, flooding him with an overwhelming sense of guilt and despair. Ianto brings Jack back to himself by holding his hand, and Jack realises that he needs Ianto more than he can admit. He identifies the creature as a parasite from the Shadow Dimensions that has evolved to feed on the sorrows of lost souls. It may feel as though the soul has been cleansed of sin after the creature is done feeding, but it's a quick fix at best, and if there are more creatures out there, they may be evolving and learning as they consume the contents of their victims' minds.
Rhys and Gwen find Claire out shopping at the sales, but Claire initially refuses to listen to what Gwen has to say to her. Eventually, it becomes clear that Claire has been cheating on Matt, and that she's afraid Gwen is going to tell her that Matt has been doing the same to her. Gwen explains that Matt's mother has been hurt, and Claire tells Gwen that Matt's mum tried to make them hold the wedding in her church. She suggests that Muriel might have taken Matt to Trevithick Hall to change the wedding plans, but Gwen suspects that, if Matt felt guilty about cheating on Claire, he might have let his mother talk him into going to church instead. She and Rhys visit St Francis, and notice that the lights are on in the vicarage even though Rev Hayward is in the church, delivering a rather intense sermon to his elderly congregation. Gwen convinces Rhys to break into the vicarage with her, and inside, they find Matt, who is terribly excited about the results of his baptism and encourages Rhys to have one as well.
Jack and Ianto visit the Torchwood boathouse, which was carved out of a cave and is hidden behind the Cardiff Barrage by a perception filter. In addition to alien water craft of various sorts, the boathouse contains an 11.5-metre speedboat called the Sea Queen, which Jack acquired after doing a favour for certain people in the early days of the Emirates. Jack and Ianto follow the tidal currents out into the Irish Sea, where they detect energy readings similar to those that Gwen had detected from the beach. They lower a remote-controlled camera probe to the sea bed, where they see a shoal of alien shrimp diving into a strange mound; the probe is too large to enter, and they must therefore dive themselves to investigate. The mound proves to be a buried shipwreck from the 1940s, and inside, thousands of alien larvae are feeding on the preserved bodies of the sailors and servicing a gigantic alien pupa that fills the entire ship from bow to stern. The larvae begin to swarm towards Ianto and Jack, but Jack notices that they're avoiding the light, and drives them back with a flash of intense light from his Vortex Manipulator. He and Ianto return to the Sea Queen, now aware of the creatures' weakness but unsure how to exploit it.
Rhys looks after Matt while Gwen searches the vicarage. She finds about 20 pairs of boots, including one pair covered with sand from the beach. When she breaks into the locked garage, she finds dozens of bodies stacked up and covered in black plastic. Matt knocks out Rhys and confronts Gwen, telling her that these are the bodies of martyrs, the Men of Sorrows who gave life to the flock. The ceiling of the garage is teeming with the parasites, which squirm away from the light of Gwen's torch but are obviously ready to begin to swarming. Gwen knocks Matt out and confronts Reverend Hayward, who is utterly convinced that he is in the right; she sees alien parasites killing people, but he sees martyrs feeding a flock of creatures that will rid the world of sin. Gwen knocks him to the ground and calls Jack to the church, but Hayward recovers more quickly than she'd expected, knocks her out and imprisons her in a tomb with Rhys and Matt. As Gwen and Rhys struggle to escape, one of the insects drops onto Gwen's arm, and she is overwhelmed with despair, reminded of all the sins she's committed in her life. Rhys squashes the creature before it can torment her further, and he and Gwen manage to force open the tomb, which was not designed to prevent living people from getting out.
While Rhys takes Matt somewhere safe, Gwen tries to stop Reverend Hayward, but she's too late; night has fallen, and Hayward opens up his garage and watches with delight as the creatures transform into their flying stage and swarm out onto the streets of Cardiff. Claire is out on her hen night when the creatures descend, and one of Claire's friends, touched by an insect, tells the others that she no longer cares about her suspicions that her boyfriend is already married to someone else. The insects descend, feed on the sins of the Friday night clubbers, and fly out to sea once they've had their fill -- leaving behind people who are suddenly free to indulge their base desires without feeling any guilt or remorse. Hayward has gone downtown with flyers, hoping to spread the word about his church, but he is horrified by what he sees; these people have not been saved, they have merely had their consciences removed along with their guilt. As chaos breaks out around him, the appalled Hayward finally realises what he's done, and in his despair he walks to the Bay and drowns himself.
Jack and Ianto return to the Bay, wondering how to destroy a creature from the Shadow Dimensions, but Gwen is waiting at the docks with bad news: the flock has already swarmed. Jack, Gwen, and Ianto follow the flock in the Sea Queen, and arrive at the wreck just in time to see the alien queen rise from the sea bed. The insects settle on its back, and it drains them dry of the sins they have collected and begins to transform into a giant winged monster. Ianto turns on all the lights on the Sea Queen, but the creature is too large for this to seriously harm it. Jack thus orders Ianto to open the reserve fuel tanks, and smashes a hole in the boat's hull, breaking the fuel line and emptying 600 gallons of diesel into the ocean around the queen. Gwen, Jack, and Ianto then fire emergency flares into the gas-slick sea. Half the boat is destroyed in the blast, but the Torchwood operatives get into the lifeboat and escape as the creature goes up in flames, killed by the intense combination of light and heat.
Back at the Hub, Ianto uses UV light to destroy the creatures gestating inside Matt; he'll survive, but his skin will be pockmarked with tiny scars. Jack consults with the chief of police, arranging for the mass hysteria to be blamed on Bank Holiday excitement and for the late Reverend Hayward to be blamed for murdering his parishioners. Gwen returns home with Rhys, still feeling guilty about the bad memories that the insects turned up, and is amused despite herself when he uses the incident as an excuse to suggest that they go house hunting. Back at the Hub, Ianto suggests to Jack that they spend a night somewhere nice with a view, and Jack agrees -- but first, he intends to burn down the Church of St Francis.