Don't get me wrong - I've seen times when as a DM I want to bail the PCs' collective ass out of a jam, be it of their own making or mine, and I'm sure you've had similar moments.
Fudging behind the screen, though, isn't the answer. Instead, make the bail-out obvious and put it in the fiction!
A divine intervention or blessing of some sort is usually the easiest to both pull off and explain; and done in rarity, such events can make for good "war stories" later. Further, events like this can provide useful adventure fodder: for getting them out of trouble then, a deity wants a favour now.....