SG-1 (minus Daniel) arrives back at SGC and report to Landry that Sam has perfected Merlin's cloaking device and gets them into a briefing with Colonel Reynolds. He reports that the Ori have commanded a planet's inhabitants to build a device that Vala recognizes: the incineration device they use to punish those who resist them. The villagers have asked SGC for their help but Sam warns her device isn't ready. Landry overrides her concerns and tells her to have it ready in the three days they have.
SG-1 arrives on the planet and is greeted by the grateful natives. Sam explains to the head woman, Thilana, that they will shift the village into another dimension and it will be restored to normal once the Prior is gone. Reynolds team is at the gate and Mitchell leaves him a final message and then Sam activates the device and they disappear. Later they are at a feast when the displacement device temporarily relocates them. Sam determines that the machine's failsafe is designed to bring them back if there's a power disruption. Mitchell suggests they evacuate and the village is divided but Thilana refuses to serve false gods. Teal'c watches the device while Mitchell checks on Sam, who is rigging a device to keep the power flowing smoothly, but the Prior and the Ori ships arrive.
Ground forces advance on the village and Mitchell hands out Earth firearms. Teal'c attacks the first wave then strategically retreats, while other soldiers reach the village and are shot down. The villagers take casualties while Sam works to finish her project. A soldier gets in behind her and shoots her in the stomach, but Mitchell arrives to dispose of him. The villagers run out of ammo and are forced to surrender, and Vala is captured. Sam tells Mitchell to activate the device since they can't escape with it. He starts to activate it but she passes out before she can give him the full instructions. Mitchell manages to get it going and the building they're in disappears. The Ori soldiers prepare to kill Vala but Tomin arrives and has her taken to the ship… while executing the villagers.
Mitchell performs field surgery on Sam while Vala is taken up to the ship where she insists she loved Tomin, but he insists he would kill her if it wasn't for Adria's orders. Instead she's to be trained in the ways of Origin and he will teach her.
Teal'c slips into the village and meets with Thilana. The other villagers insist she yield to the Ori. Mitchell plans to slip out of the field and plant C-4 but Sam tells him not to sacrifice the device for her.
Tomin teaches Vala while she asks him how many people he killed. He tries to ignore her accusations and slaps her when she says the Ori are not gods. The Ori soldiers demand answers of Thilana and Matar betrays Teal'c. The guard takes Teal'c into custody, and Matar and Thilana as well.
Vala tries to explain the background of the Ancients and the Ori but Tomin leaves. The Prior confronts Teal'c and probes him for information, but he passes out. Matar begs for mercy and the Prior demands to know what happened to the building. Mitchell looks on and Sam asks him to deliver her personal letters upon her death. He gives her a pep talk but they're interrupted when the Prior steps into the building space and scans for them, but is unsuccessful. The Prior returns to the ship and tells Tomin he is to destroy the village, against Tomin's belief in the teachings of Origin.
Mitchell realizes what the Prior plans as the soldiers evacuate and asks Sam what they're going to do. Thilana wakes up Teal'c and admits she told them about the device, and Matar prepares to kill Teal'c as a sacrifice and Thilana if she gets in the way. She tries to get through to Matar and he gives up the knife.
Tomin goes to Vala and demands to know why Mitchell and Sam are willing to sacrifice the village. Vala points out that if he thinks the Prior is wrong, he is the only one who can do something about it. Meanwhile, Sam instructs Mitchell in using a power crystal from the Ori weapon to power the cloaking device but begins to lose her concentration.
Aboard the ship, Tomin talks to the Prior about his doubts and insists he won't kill the villagers. Mitchell slowly manages to hook up the power crystal and has Sam access the laptop. The Prior fires energy blasts down on the village, destroying it, and Tomin gets Vala free. He admits he still loves her then teleports her down to the planet just as the ship breaks orbit.
Vala explores the empty blast crater and then the village appears with everyone safe: Sam managed to expand the range of the device just in time. Later back at SGC, Mitchell visits her with a bag of macaroons like his grandmother used to make: she hates them.