The TARDIS materializes, but erratically as if the TARDIS doesn't want to appear. They've appeared in some kind of metallic storage bay inside a base and go look around. The Doctor identifies it as a deep-space exploration bay where drilling is occurring. They notice graffiti that says "Welcome to Hell" but the Doctor notices other ancient writing underneath it that the TARDIS can't translate due to its age. They open a door and are confronted by grotesque alien creatures who state "We must feed" and advance on them.
However, the aliens stop and then repair their translators and it becomes clear they're saying "We must feed you." Humans barge in and demand to know who they are, claiming it's impossible for them to be there. They're interrupted when they get word of a big incoming. They run for shelter into a control room where the rest of the base's crew are, and the base is shaken by some vast impact. The acting captain, Zachary, sends Toby to check things out while the science officer, Ida Scott, introduces the rest of the crew. They open a panel to reveal a black hole, which the Doctor notes is impossible as they can't be in orbit around it. Zachary explains that the planet they're on generates a constant gravity field that protects it against the black hole, and they got to the ship by flying down the gravity field, although they lost the original captain.
The alien attendants, the Ood, bring refreshment and the crew explain that they are slaves, apparently willing ones. The Doctor notes that it would require a vast power source to generate a gravity field. The buried power source was apparently left behind by the ancient civilization that once inhabited the planet. The head of security, Jefferson, notes that the power source could also be used for war. The Doctor ducks answering questions about how they arrive but Zachary notes that the storage bay they entered was destroyed during the last impact. The Doctor runs back with Rose to discover that the TARDIS is gone, fallen into a vast chasm.
The Doctor tries to get Zachary to divert the drilling toward the power source but he refuses. The crew but the Doctor and Rose on the duty roster. In his quarters, Toby hears a voice whisper his name but can't identify it. In the messroom, the Doctor works to decipher the ancient writing while Rose talks to an Ood. It talks about a Beast rising from the pit to make war against God, but when Rose asks him to clarify he claims he simply said for her to enjoy her meal. As Zachary checks the pressure readings, the screen briefly morphs into an image of a horned beast, but it disappears and he assumes it's a system glitch.
In his quarters, Toby hears the voice again and it warns that if he turns around to look at it, he will die. The figure continues to taunt him and Toby finally turns only to see nothing but a glowing spot on the wall. He then reexamines the pottery he was holding but finds the writing on it has vanished. Taking off he gloves, he sees the writing on his hands. Worse, picking up a mirror he sees it has now covered his entire body. He collapses unconscious.
In the messroom, the power flickers and Zach mentions that a civilized system is being pulled into the black hole. They look on as it is destroyed and then the Doctor notes that they are stranded far from Earth. Rose's phone no longer works and the Doctor can't build a new TARDIS. The Doctor doesn't want to settle down although Rose notes they could move in together. Then Rose's phone rings and a voice says, "He is awake." Elsewhere, Toby wakes up, his eyes glowing red. The Doctor and Rose talk to Danny of the Ethics Committee about the Ood, but he dismisses them as herd creatures and says nothing is wrong with them. Danny says they have a low telepathic level but as they watch their telepathic level increases. The Ood all turn and say "He is awake" and they will worship "Him."
The trainer maintenance officer, Scooti, goes to find Toby but he's gone. She notices a nearby airlock has been opened but no spacesuits are missing. She tries to contact Zachary but can't get through. The station computer can only say "He is aware." She looks out the window and sees Toby standing unprotected (but still alive) on the uninhabitable surface. He grins maniacally at him and gestures for her to join him. She starts to obey, compelled, but breaks free. In response he cracks the window telekinetically and she is sucked out into the vacuum. The breech causes the station to shake and the remaining crew get back to the living quarters. Toby, now unmarked, is there but Scooti is gone. As a puzzled Toby examines his hands, the others go for a drink but the Doctor notices Toby's confusion and asks what happened. Toby doesn't appear to remember what happened and they take him back to the messroom. They open the observation bay only to see Scooti floating in space above them, dead.
Suddenly the drill stops--they've reached the power source. Danny confines all non-essential Oods are confined and the Doctor volunteers to go the power source with Ida. Rose bids him goodbye and warns him to be careful. The Doctor and Ida descend in a cavern while up above, Toby looks on. The Ood start to move on their own, ignoring Danny's orders, while the Doctor and Ida reach the bottom of the shaft. They discover the lost civilization's remnants there and start exploring. Danny reports that the Oods' telepathic activity has peaked and they should be dead, but they're still moving but unharmed.
The Doctor and Ida find a huge seal covered in the ancient symbols. Rose asks Toby if he has translated the writings and he starts speaking of the Beast as his eyes glow red and he's covered in symbols again. "Toby" confronts the security guard, Jefferson, and taunts him of how his now-dead wife never forgave him. The symbols on Toby's face drift off of him and attach themselves to the Ood, which announce themselves as the Legion of the Beast. The Doctor, hearing everything, starts to go up while the Oods start moving out, chanting of how the Beast is also known as Satan. The Ood kill one man with their translation sphere while the others run.
At the bottom of the shaft, the ground shakes and the great seal starts to open. From the command center, Zachary checks the monitor and realizes the planet is moving. The gravity field has stopped and the black hole is sucking them in. The Doctor and Ida look on as the voice of the Beast says that finally it is free…