If you're a GM in the situation of having to ad lib an adventure - and let's face it, that happens nearly every time the players make any decision whatsoever - utilise the best resource at your disposal: the players themselves. It doesn't even matter if they're not in character and are just commenting on the latest episode of Game of Thrones or whatever. If what they're saying isn't completely off the wall, adopt it into your adventure in some way.
You don't have to be so obvious about it, either. Sometimes just a word or two will tickle some fancy in your brain and you can expand them into some situation that you hadn't thought of before. Maybe someone will mention a battle where a giant fought. Have a giant walk around the next corner the PCs approach in the game. Not necessarily looking for a fight, but perhaps the players' minds will jump to conclusions, having been primed by their prior conversation.
Transcript
GM: All right then. While Ben takes Chewbacca to Kashyyyk, Corey, Sally, Pete, you three head to the lava world of Kamino.
{a ship arrives at the now lava world of Kamino}
C-3PO: It's not lava any more. They put the water back.
GM: Right. Luke and the droids land on one of Kamino's storm-tossed ocean city platforms.
{the scenery suddenly changes from lava to ocean}
C-3PO: {aside} Yay!
Luke: The Force is obviously guiding me to where Yoda is.
GM: Um—
Luke: Like it did on Dagobah.
GM: —sure.
C-3PO: I can describe the cloning facility again for you.
GM: Why not?
C-3PO: Obviously if they're accelerating development of clones, they need a place to socialise them and teach communication skills, teamwork, and initiative.
GM: Yeeesss...
C-3PO: An improv theatre!
R2-D2: Annie would be so proud.