In 2116, the Doctor and Clara arrive in an underwater base, which is being haunted by strange, eyeless ghosts-one based on a crew member who died, and another dressed as an alien mortician.
It turns out that the ghost problems started when the crew unearthed an alien craft from a flooded town nearby. The ghosts however mainly disperse during the undersea base’s ‘day’ mode. After the settings are once again switched to night and the Ghosts claim another victim, The Doctor devises a trap for the ghosts using a cage that is sealed from the rest of the facility, and with the help with one of the deaf officers who can read lips.discovering that they are some sort of signal guiding something to Earth. They also discover a casket in the city that might have some link to all of this.
Unfortunately, Clara and part of the crew are cut off from the Doctor, and the Doctor figures that there might be a solution to all this in the past before the town was flooded. However, as he takes part of the crew back with him, a new ghost appears in the future-that of the Doctor. However, instead of using guiding coordinates it’s listing people who are going to die next-with Clara one of the names. The Doctor and Clara remain in contact via her modded cellphone, as she relates what’s happening on the base. The Doctor is somewhat disturbed about the ghost, figuring he might finally die.
Meanwhile, in the 80s, the Doctor discovers that the craft is in fact a coffin for the “Fisher King”-an alien who is actually, very much alive, and is using the ghosts as a signal for an invasion of Earth. He also claims the life of another member of the base staff, causing another ghost to pop up in the future.
Confronting the Fisher King, the Doctor is able to trick him, causing the flood in the past, killing the Fisher king (He sends the other guy back to the future using the TARDIS.) But what happened to the Doctor? He’s not in the TARDIS, and a whole town just flooded on top of him. Could the ghost be the dead Doctor?
Meanwhile in the future, the ghosts continue to pursue Clara and co. However, it’s revealed that the individual inside the stasis coffin isn’t the Fisher King, but actually the Doctor, who sealed himself in to protect himself from the flood. His “Ghost” was actually a hologram controlled by the sonic sunglasses, and he uses it to lure the ghosts back into the cage.
Back in the TARDIS, the Doctor explains that he programmed the hologram to say that Clara would die, to give her incentive to save her. However, the Doctor hadn’t programmed the hologram yet at the time it appeared, and only knew it said Clara’s name due to her calling him on her cell phone from the future. To illustrate, he brings up the bootstrap paradox as an allegory, stating that a time traveler would travel to meet Beethoven, who he admired, but then discovered Beethoven never existed. So this time traveler publishes his work, sort of taking Beethoven’s place. However, if Beethoven never existed, where did the idea for his symphonies come from?