Haven't DMed much in a while, I got lazy and just wanted to play (hey! DMing is a lot of work!

)
I've DMed a few campaigns and Percivellian's advice is on the money. Especially the parts about expecting the players to do what you least expect (don't anticipate this, just be prepared, know your material and let them run with it) and winging it, winging it is the key.
For laughs I once ran a one-night 4 hour session with a page of notes, some vague ideas and a bit of imagination. It was DnD horror and the players were actually freaked out by the story and environment more than the two encounters they actually faced. I've also run a game where the PCs did everthing wrong, missed all the clues and got slaughtered, it was a one off game, otherwise it would have been totally fudged to avoid the TPK. It can happen, but it shouldn't happen *ever* in a campaign style game. Learn and move on if/when it does.
Just remember that you've got the advantage, you know (or pretend to know

what's going to happen, the players don't know what's supposed to happen and if anything 'goes south' on you just take it in stride and adjust your storyline accordingly. Keep your cool, make the story up as you go along if you have to, if the PCs stray too much think of some sort of 'carrot on a stick' to bring them back to the story. Clues work well for players interested in story, worthy foes for those that like violence, honours for PCs who seek fame, etc. etc.
Don't be afraid to make up all the stuff that isn't written down. Winging it and fudging are at least 50% (sometimes 90%) of running a game. Just make sure everyone's having fun, that's why you're playing, right?!
Cheers,
GMonk