The team is approaching a space Gate in the Puddle Jumper. Sheppard has an insect attached to his neck, acquired during the recon mission, that is slowly draining the life from him. The other team members are racing to get him back to Atlantis. But, as the Jumper enters the Gate, a drive pod fails to fully retract and the Jumper becomes stuck partway through, trapping Ford, Teyla, McKay and the ailing Sheppard in the rear compartment.
They have only 38 minutes to resolve the situation, after which the Gate shuts down. The front half of the Jumper, and those in it, will fail to rematerialize and the back half will be cut open at the event horizon, exposing everyone in it to hard vacuum. Those in the Jumper can communicate with Atlantis via radio. Weir gets the scientists started on the Stargate problem and the medical team on Sheppard's situation.
Ford explains to Weir what happened to cause this (which are shown in flashbacks). We see Sheppard's team return to the planet where the Wraith had held Teyla, Halling, Sumner and the others only to discover a crater where a mountain once was. Teyla theorizes that the "mountain" was actually one of the great Wraith hive ships and must have simply lifted off and departed. They are then attacked by a group of Wraith and the drive pod was hit by a Wraith Stunner.
Sheppard regains consciousness and is briefed by McKay. With time running out, the scientists consider various solutions. Their first idea, to isolate the rear section by closing the bulkhead door to create a "lifeboat", is of limited use. Meanwhile, Zelenka is attempting to identify the control pathways that will allow McKay to retract the drive pods without impacting other critical systems. There is a possibility that, in his attempt to retract the drive pods, McKay could cause a catastrophic overload. Not only would this kill the team, the explosion could cause debris to be forcefully shot through the Stargate into Atlantis itself. Weir decides to risk it and does not raise the shield, deciding not to give up completely on those trapped.
Meanwhile, Beckett, working through Teyla and Ford, is trying to help Sheppard. They attempt to get the insect to release its hold on the Major's neck by pouring various substances on it but nothing works. The creature has a particularly bad reaction to salt water, causing it to tighten its grip even more on Sheppard, further weakening him. They consider sending Sheppard through the event horizon to give them time to come up with a solution, but Beckett is afraid it would trigger a further reaction from the creature.
In desperation, Ford uses a portable defibrillator unit to stop Sheppard's heart. The creature, now deprived of sustenance, releases its grip. Ford attempts to restart Sheppard's heart but is unable to revive him. Teyla drags the Major over the event horizon to "preserve" him until a medical team can get to him.
The scientists manage to identify the way to retract the drive pods safely and McKay implements the procedure. However, the Jumper remains immobile. In a desperate move, Ford sends McKay through the event horizon and then opens the rear hatch. The reaction propels the ship forward into the Gate.
With only seconds left, the Jumper arrives in Atlantis and Dr. Beckett successfully resuscitates Maj. Sheppard.