Quoting myself, "It is not a failure to be completely unprepared for what players want to do (in the game). It is a failure if you tell your players that because of their surprise choice, you have to cancel today's game, so that you can prepare."
What? Digging a hole in the wall of the dungeon isn't in your game module's design? The players are outside the box again. Okay, okay, we'll let it go. Maybe we'll get a few fun sessions out of this new direction. That would be great. Then we can all get back to TELLING MY STORY... But I digress. I am not here to talk about the sin of getting the players back into the (my) storyline. I am here to discuss being ready.
I am all about preparedness, being ready for what I think the players will do in the coming games sessions. More than that, I am all for being prepared for what the players have not thought about doing, or may never do. That all said, there will be many times when I am not prepared. My players are geniuses, smarter than me by any standard. They will come up with stuff that I have not considered. So what should I do? Should I say "no you can't do that"? Of course not (unless it is impossible.) Should I trick them into doing what I want them to do, what I am prepared for? Again, of course not. Should I sweeten the pot to make my desired path a better option? Again, no. I am not here to manipulate or lie to my friends and loved ones, as I have said before.
So, think on your feet. Use your imagination. Be brilliant. That unformed idea that has been kicking around in your brain? Make it happen. Free yourself!