The Tenth Doctor and Martha receive a distress signal from the SS Pentallian, a human spacecraft that is hurtling towards the sun of the Torajii system. The Doctor pilots the TARDIS towards it to help, but after arriving they are separated from the TARDIS by the rising temperatures on the ship. The ship’s engines have failed and they have only 42 minutes left before the ship plunges into the sun. They need to reach the bridge controls but find themselves separated from them by thirty deadlock sealed doors that are each password encoded. Martha teams with Riley to work their way through the doors, having to answer pub quiz questions in order to open each door. The Doctor helps the engineering team try to repair the engines. Martha uses her modified mobile phone to call her mother Francine on present-day Earth to answer one of the questions. Francine asks questions about the Doctor that Martha ignores.
One of the crew, Captain McDonnell’s husband, Korwin, has been infected with something that is causing his body temperature to rise to incredible levels. They attempt to sedate him while they continue the repairs, but the sedative doesn’t work and Korwin escapes. He dons a welding helmet and starts killing crew members before infecting a man named Ashton. As Martha and Riley continue to work through the doors, they encounter Ashton and take shelter in a nearby escape pod. Ashton launches the pod, but McDonnell freezes him to death in a stasis chamber. The Doctor performs a spacewalk to activate a magnetic control that recovers the pod. He gets infected by the sun, and learns that the sun is actually a living being and that the crew illegally drew the star’s heart to use as fuel, and now the sun is trying to recover its lost parts. Martha puts the Doctor into a stasis chamber to save him from the infection, but Korwin appears and disables the chamber. The Doctor insists that Martha leave him and warns the crew to dump the fuel, which should allow them to escape.
Martha relays the Doctor’s message to the crew. McDonnell encounters Korwin and apologises to everyone before blowing Korwin and herself out of the airlock. The ship vents its fuel and the engines restart, allowing them to pull away from the sun. After Martha calls Francine again, a woman who was monitoring Francine’s phone confiscates it and leaves.