While exploring an abandoned and claustrophobic moon base, Sheppard's team is startled when a man, Herick, materializes in one of the rooms. He has emerged from a modified version of a Wraith beaming device, and he has a bizarre story to tell.
Long ago, before an apocalyptic Wraith attack, his people on the planet below planned to hide two modified beaming devices on this secret base. Within each of these pattern-storage modules, they archived the energy signatures of 1,000 inhabitants of their planet, hoping to beam them back into existence someday when the Wraith threat was past. Herick's job was to rematerialize all these people, so the base's computer automatically restored him when McKay activated it.
Herick is shocked to learn that the moon base holds only one of the two modules. His wife and child, who were in the missing module, are lost. Furious, he rematerializes another of the project's leaders, Jamus, and demands answers. Jamus explains that they ran out of time to transport the second module from the planet before the attack, so they decided to destroy it to prevent the Wraith from discovering the plan.
Herick is devastated. Moments later, in suicidal vengeance, he blasts a hole in the base's exterior wall and dies instantly in the resulting explosive decompression. Sheppard's team struggles to seal themselves in various chambers as wind and debris whip through the base.
Sheppard and Ronon are locked in together. Teyla and Jamus are trapped with the surviving module, which contains the last thousand of Jamus's people. McKay, stuck alone in the base's control room, soon discovers that their situation is even worse than they thought: the explosion has destabilized the small moon's orbit. In a few hours, the moon and its base will plunge to a fiery death in the planet's atmosphere, and there's nothing anyone can do to stop it.
The trapped team struggles to maintain patience and hope until Maj. Lorne arrives from Atlantis to rescue them. Even then, the crisis isn't over. Jamus rightly suspects that without the specialized equipment needed to transport the pattern storage module easily, Sheppard's team won't risk their lives trying to save it from the moon's imminent destruction. In desperation, Jamus takes Teyla hostage, then beams himself and Teyla into the device. Now, if Teyla's friends want to see her again, they must find a way to transport the module to safety - as the moon breaks into flaming fragments around them.