A police officer, Lucy Hayward, wanders the halls of a seemingly abandoned 1980s-style hotel as taped music plays on the speakers. She finds a sad clown in one room and a photographer in another, insistently taking pictures of her. Lucy closes the door of each room and then goes into a third. A gorilla charges out of the bathroom and Lucy hastily retreats out into the hallway. She starts writing in her notepad, unaware that somewhere, a creature is stirring. She writes down about how the gaps between fears are coming shorter and then says that she's happy now. Lucy writes down the words "praise him" repeatedly, and then stands up, smiling, as the creature moves down the hallway toward her.
The Doctor, Amy, and Rory find themselves in the hotel and assume that the TARDIS has taken them off-course again. The Doctor is thrilled to discover that the hotel is an authentic recreation of a 1980s hotel and figures that someone decided to build it to look like one on Earth. They find a wall of photographs of humans and aliens, each one with a name and a caption such as "Defeat" or "That brutal gorilla."
The trio makes their way to the front desk and come face to face with three other visitors: two humans and an alien. The woman, a medic named Rita, quickly realizes that the Doctor and his companions are just as lost as they are. The Doctor identifies the alien as Gibbis from the planet Tivoli, the most invaded planet in the galaxy. The third newcomer, Howie Spragg, is a conspiracy site blogger from 21st century Earth as well. The three of them tell the trio that the walls and rooms of the hotel move as if they're alive. The Doctor switches off the music and goes to check the front door and the windows, only to discover that they are solid walls. Rita tells him that each room is filled with a bad dream, and that none of them can remember how they found themselves in the hotel.
The Doctor tries to get everybody back to the TARDIS for safety but discovers that it has disappeared. The music comes back on all by itself and the Doctor worries that they are caught in a terrible situation. Rita says that there is one more person there: Joe Buchanan, who they had to tie up. She takes everyone to the lounge where Joe is tied to a chair and surrounded by laughing ventriloquist dummies. The dummies stop laughing as the group enters and turns to watch them. The Doctor talks to Joe, who says that "He" has forgiven him and will soon feast. When the Time Lord asks what He is waiting for, Joe says that they haven't ripened yet, and that they are still raw. As they talk, the Doctor notices that Joe is wearing several good-luck charm. Joe tells him that he used to fear ventriloquist dummies but now enjoys them. He laughs hysterically and the dummies start laughing again, joining him in hilarity. Joe tells them that they should go so that He can claim him, but the Doctor loads him on a cart and takes Joe with them.
The group returns to the lobby and the Doctor tries work out what's going on without success. They start searching the hotel for the TARDIS and he tells them to stay together and not enter any rooms. As they prepare to go, Joe laughs again and tells them that He is coming to kill him. They gag him and take him with them as they search the hallways. Howie tells Rory about his conspiracy theory that they are in a secret U.S. sanctuary prepared for the rich against the Earth's destruction. A P.E. teacher comes out of one room and confronts the Doctor, railing about his lack of gym kit, but none of them know who he is or are frightened by his appearance. He goes back into his room and they continue searching. Rory opens one door and finds a group of girls, all laughing at him and calling him a geek. The words "praise him" echo in his head. He backs out and slams the door, and tells the Doctor that it's all a CIA conspiracy. The Doctor encourages him to believe in that if it helps him face his fears.
As they continue their search, the Doctor notices scratch marks in the ceiling. Amy finds the notepad pages that Lucy left behind and picks them up. Rory spots a fire door that no one else has noticed and tries to point it out to the others. A growling noise echoes through the hallways and the group splits up and goes into different rooms to hide. Rita takes Joe into one room and finds her father waiting there to condemn her for her poor grades in mathematics. She collapses, sobbing, and tries to apologize to him.
The Doctor and the others go into another room and find two Weeping Angels waiting for them. Gibbis hides in the wardrobe and the lights flicker. The Angels advance on them during the periods of darkness, but the Doctor realizes that they're not real because they would all be dead by now if they were. He realizes that they're one of Amy's fears and tells her to focus on him, not them. The Doctor then turns to the door and looks out through the spyhole as the creature goes past, and says that it's "beautiful."
As Rita copes with the image of her father, Joe tries to free himself. His ropes untie by themselves and he runs out into the hallway before Rita can stop him. Joe yells "praise him" and calls the creature to him. By the time the Doctor can get there, he sees the creature hauling Joe away. The Time Lord follows but by the time he catches up, Joe has been killed and abandoned.
The remaining group members return to the lounge and barricade themselves in. When Gibbis worries that the creature will kill them all, Amy assures the alien that the Doctor has always saved her and will save them all this time. Gibbis, who recognized the Angels, says that they are his greatest fear and wonders what Amy will face. Meanwhile, the Doctor and Rita discuss Joe's death and he admits that Joe's life force was simply extinguished, as if something had stripped him of all his hopes and dreams. Rita makes him a cup of tea and suggests that they might be in Muslim Hell, but tells the Doctor that because of her faith, she's not afraid. Amy takes the time to read Lucy's papers and gives them to the Doctor. He reads her notes about how she was the last of her group and that they were killed one by one. Finally only Lucy was left and she saw a vision of a gorilla from a childhood book that had scared her. At the end, she wrote "praise him" repeatedly and gladly went out to give herself to the creature.
As the Doctor finishes reading, Howie suddenly blurts out "praise him." He can't stop, and the creature hears him and heads for its newest victim. As everyone panics, the Doctor gets their attention with his sonic screwdriver. Gibbis suggests that they sacrifice Howie to save themselves, hoping the creature will be satisfied with him. Rita refuses to abandon Howie and offers to stay with him. The Doctor says that they're staying together and privately talks to Gibbis. He warns him that he knows that Gibbis uses cowardice as a defense mechanism and will do whatever he can to survive. However, the Doctor promises Gibbis that he'll save the rest of them.
The Doctor talks to Howie and tells him that he'll ask him questions the next time he's possessed. When Howie is taken over, the Doctor asks why the creature isn't possessing the rest of them and Howie tells them that they have distractions. He says that the others should let their distractions go, and that he's happy that they will all soon die. The Doctor tells the others that the creature feeds on their fear and they have to resist long enough so that they can capture the creature and confront it.
Later, the creature moves through the hallways when it hears Howie calling from the hotel spa, saying that he wants a glorious death. Amy and Rita hide in a room near one spa door, ignoring the sad clown sitting on the bed. When the creature enters the spa to claim Howie, Rory bars one door with a broom handle and Amy and Rita lock the other door behind it. The Doctor is inside and turns off the lights, and then calls to the creature while using mirrors to hide himself. The creature searches the spa and discovers that Howie's voice is being pumped in via the speakers, and he's actually at the lobby desk, being guarded by Gibbis.
The Doctor turns off the speaker and calls to the creature, asking it to explain itself. It speaks and the Doctor understands that it's saying that the hotel is its prison. Meanwhile, Howie realizes that he's been tricked into trapping the creature and suggests to Gibbis that the alien should just release Howie and claim he was overpowered, because Howie wants to go to the creature.
The creature tells the Doctor that he and the others aren't "ripe" yet, and that it has lived so long that it can't remember its name. The Doctor understands that the creature is operating on instinct and can't stop itself from feeding and killing. Before he can get more answers, Howie calls over the loudspeaker, saying that he's free and the creature should find him. The creature smashes through the door, knocking Rory down, and goes after Howie. The Doctor follows it through the maze of hallways and Amy starts to go after him. However, she is drawn to a room, Number 7, and hears the words "praise him" echoing in her mind. Rita manages to stop Amy before she can go in and asks what she saw, but Amy says that she didn't see anything and goes after the Doctor.
The Doctor finds Howie's corpse as the others arrive. Gibbis comes up and claims that Howie got free and overpowered him, and says that now the creature will leave them alone. The Doctor walks away, disgusted, and they go back to the main hallway. Howie's photo is now posted with the others. As Amy and Gibbis go to the lounge, the Doctor asks Rory if he's seen his greatest fear yet. Rory says that he hasn't and that perhaps after everything he's faced the TARDIS, there may not be anything that he fears. He points out that while talking with Howie, he learned that the blogger had recently overcome his stutter and tells the Doctor that he's forgotten that not all victories are about saving the universe.
The Doctor checks on Rita and tells her that he'll save them all. She asks why and the Doctor explains that he brought Amy and Rory there, and that it's his fault because he tempted them with the idea of traveling through all of time and space. She accuses him of having a God complex but the Doctor, undeterred, promises that he'll take her with him in the TARDIS. As the Doctor returns to the search, he notices that the security cameras are working along with the rest of the hotel. Once he leaves, Rita looks up at the camera, goes into a trance momentary, and says, "praise him."
The Doctor continues searching for the TARDIS and finds Room Number 11. He looks inside and sees something, and says "of course." The Doctor then closes the door and puts a "Do Not Disturb" sign on the knob. He goes to the security room to check the monitors and sees Rita on the monitors. He calls the room she's passing and she answers the phone, and the Doctor asks if she's started to praise Him. Rita says that she has and refuses to come back when he asks. As Amy and Rory find the Doctor, Rita says that she can feel the rapture approaching and tells the Doctor to turn off the monitors so that he won't witness her death and can remember her the way she was. The creature approaches her and Rita tells the Doctor that she wants peace. She hangs up the phone and the Doctor turns off the monitor as she requested.
The survivors bring Rita's body back to the lounge with the others and the Doctor breaks things in frustration. Once he calms down, he tells the others that he doesn't know why Rita died since she was calm and brave and the creature feeds on fear. Gibbis points out that the Doctor wasn't able to save the others and is no closer to saving them, and Amy insists that the Time Lord will save them all. The Doctor realizes that the creature isn't feeding on fear but on faith. Howie believed in a vast underlying conspiracy, Joe believed in the power of good luck, and Rita had her Muslim beliefs. Gibbis believes that invaders will always conquer his planet and bring stability to his life. When the Doctor told them to draw on something greater than themselves to face their fears, he was unwittingly leading them to their deaths. Since Rory has no faith, the hotel showed him the fire door and the way out because it didn't want him. The creature wants Amy because she has faith... faith in the Doctor.
The creature starts to possess Amy and they run away, taking her with her when she looks back. They lock themselves in Amy's room, Number 7, and find a young Amelia Pond waiting for the Doctor with her bags packed. As Gibbis hides in the wardrobe and Rory tries to hold the door shut against the creature, Amy collapses to her knees, sobbing. The Doctor goes to her and admits that he's the one who has led her to his destruction. He robbed her of her childhood, all so that he could have someone to adore him.
The creature bursts into the room past Rory and the Doctor tells Amy that it's time forget her faith in him and stop waiting. The creature backs out, clutching at itself in pain as it starves, deprived of its foot. The Doctor goes to it and takes its hands as the structure of the hotel flickers and then unfolds, revealing that they're in a plain black chamber containing the TARDIS and a control panel. The Doctor checks the panel and confirms that they're aboard an automated prison ship. The creature is one of a race of aliens who pretended to be gods until the people they victimized turned against them and imprisoned them. The ship travels from planet to planet, capturing residents with a strong faith and beaming them aboard the ship to "feed" the prisoner. The automated program developed a glitch and became stuck, holding all the projected fears of the previous victims. Amy wonders why the ship summoned the Doctor but he refuses to answer and goes to the dying creature. As it dies, it speaks and the Doctor translates for the others, saying that it's speaking of an ancient creature who dies in relief after centuries drifting in space, caught in an ever-shifting maze. As the Doctor tells it to die in peace, it says that it wasn't talking about him.
The Doctor returns Gibbis home and then lands the TARDIS on Earth outside a flat. There's a red sports car outside the Doctor tells them that the flat and the car are for them. While Rory checks the car and the flat, Amy asks the Doctor if he's leaving. He promises her that he'll turn up again someday, but for now it's best that he leave while she's still breathing. She wondersif shecan justlet him go finally after everything they've shared, but the Doctor says that it's better than standing over her grave. Amy asks him to tell her daughter to visit sometime and hugs him, and the Doctor tells her to look after Rory. As the Doctor leaves in the TARDIS, Rory asks her what he's doing, and Amy tells her husband that the Doctor is saving them.