The advice I always give for GMing is, when you're not sure what to do next, whether it's how to incorporate all the PCs, how to solve a problem you didn't plan for, or how to fill time/compensate for an adventure going off the rails etc. is to just...shut up and let the players solve the problem for you.
Great example I was given was a group who were after some NPC that double crossed them. They finally corner him and try to enact their plan to capture him, but the GM needed him alive for something later. So he just said that their spells failed, their attacks fail, and when they ask why, he just smiled at them and said 'by now, you should all know why'. He sits back, stays quiet, and watches them consult notes and talk to each other...before coming back a few minutes later with a perfectly reasonable explanation for why the NPC could survive their attacks, seeing as how he was secretly a were-rat all along and was using a magic item the party had mysteriously lost a few episodes back. He just nodded and agreed with them, praised them for figuring it out, then wrote all of this down and had a new were-rat villain with a magic item to use. Next session they all want to go get silver weapons, etc.
What the players will come up with will usually be what they want to do or see, so just roll with it and you'll usually have a better time than if you always stick to the plan or worry about how things are going. If you can just give them the first 10% as a prompt, most RPers are happy to dream up the next 90% for you, since creating characters and scenes is what everyone wants to do anyways.
Edit: This is actually pretty close to what Ame said, with a slight deviation in the middle. Nice.