Whilst travelling through the vortex on the way back to U.N.I.T. HQ Sarah sees an apparition inside the TARDIS. The Doctor is more concerned with the console, and misses it. The TARDIS is drawn off course and lands in the correct location, but in 1911, when the priory is still in use.
A worshipper of an Egyptian God, Sutekh, has been killed, and the priory now houses the servant of Sutekh, Marcus Scarman. His brother, Laurence, is concerned, but is killed.
Sutekh is trapped in a pyramid in Egypt. He is held in place by a beam from Mars. With the aid of robotic Mummies, Scarman plans to build a bomb to destroy the radio on Mars, which would free Sutekh.
The Doctor manages to destroy the bomb, but falls under the influence of Sutekh, and he unwittingly takes Scarman and Sarah to Mars. Scarman tries to kill him, and thinking he was dead Sutekh relinquishes his control. Scarman, under the control of Sutekh, destroys the radio beacon on Mars.
There is a two minute time difference between Mars. The Doctor and Sarah quickly travel back to Earth, and using equipment from the TARDIS the Doctor blocks Sutekh's freedom, and instead sends him far into history. By the twentieth century he will have died.