The Doctor and Companions land on the Moon. It's fun times flying around in low gravity. But the situation soon becomes very grave. On the moon is a moonbase housing a weather control station. They are using a kind of gravity control device to control weather, but the station is having problems and the people on earth are bitching up a storm. To make matters worse some of the crew is coming down with a strange sickness. And by coincidence the Doctor and Companions arrived at the same time so it must be them who caused it, though there's no proof. Eventually they're able to figure out the disease is due to bad sugar, and that there are Cybermen setting up to attack the base.
Jamie had come ill with something and was having raving delusions of seeing something he described as The Piper. It's not explained but seems he's repeating some kind of Highland myth of a Phantom Piper (yahoogling 'Phantom Piper' does turn up some Scottish legends) but in truth he was actually seeing a Cyberman.