There is currently much unease with the fact that austerity programs may backlash because their contractionary effects would eliminate any potential gains for the public budget. This is certainly a shared view among many Keynesian economists, as evidenced by this Krugman post. Indeed, there is no reason why, in the current circumstances, the maximum feasible budget surplus in say Greece or Spain should be positive. In other words, the surplus need not be an increasing function of the degree of austerity. This function instead could be hump-shaped and have a maximum at, say, -4 percent of GDP.
Ironically, the same mainstream Keynesian economists have always sneered at the idea of the Laffer curve, which states that because of the disincentive effects of taxation total tax receipts eventually fall as tax rates go up. Yet this is a very similar idea to the current view that austerity programs may backlash. However mainstream Keynesians do not believe in the empirical relevance of the Laffer curve, at least at the margin of our historical experience. This is because they believe that the supply (of labor and capital) is rather inelastic to prices (i.e. wages and the return to capital). However the story is entirely different in a recession, because the theory says that output is then demand-determined, and that demand is quite elastic to government policy. Thus from a Keynesian perspective there is a short-run Laffer curve which is more pronounced than the long run one. Just the opposite is true from a Classical perspective: the long run Laffer curve is then supposed to be more constraining than the sort-run one, because in the long run people are more reactive to changes in tax rates than in the short run.
In principle, one should also be careful to distinguish between adjustments based on tax hikes versus expenditure cuts. Expenditure cuts are supposed to work their way through the expenditure multiplier and therefore to have a strong Laffer curve effect. Tax hikes should have only indirect effects through their non-Ricardian consequences  for consumption and investment. Thus in principle tax hikes should be preferred from the pure viewpoint of balancing the budget in the short run. Of course things are more complex: the more the party in government increases taxes, the more it signals to the public that it intends to spend a lot in the future. Those news may trigger a far more substantial drop in consumption and investment than pure non-Ricardian effects.
So what would happen if a country is at the top of the short-run Laffer curve with a budget deficit of, say, 5 % of GDP? This deficit has to be financed somewhat. If at such a deficit level the country can no longer access borrowing, it will have to rely on support from abroad or from the ECB, for as long as the recession lasts. And it would be obviously foolish for the rescuers to ask for austerity measures, as the 5 % deficit is the smallest possible figure. The problem with such a strategy is that it postpones any required structural adjustment and relies on the belief that the slack will disappear soon enough, at which point austerity will no longer have adverse consequences on activity. In principle, then, one could at that point increase taxes and reduce expenditure so as to produce a budget surplus that would allow to reduce the debt. To believe in such a strategy one has to be pretty optimistic and believe that (i) such future tax hikes will have only small distortionary effects (in other words one has to believe that the Keynesian Laffer curve is important, but not the Classical one) and (ii) it will be politically feasible to reduce public expenditures once things are back to “normal”, even though in the case of Greece this never occured before the crisis.
If, on the other hand, the country is not rescued and lending stops, the Keynesian Laffer curve tells us that some catastrophy must occur: the government will have to cut expenditures immediately by an amount equal to the primary deficit, which will in turn deepen the recession, reduce tax receipts and call for further austerity measures, until the economy reaches the zone where the top of the Keynesian Laffer curve delivers a primary surplus. Such a point must exist, for at a zero expenditure level, there is no primary deficit. But it can be a very low point.
 Note: people expect budget deficits to be met by future taxes. Reducing them now by tax hikes should reduce expected future taxes, therefore people need not feel poorer and need not react by cutting their own private expenditures. This is what is called Ricardian equivalence. But if people expect future generations rather than themselves to pay for the future taxes, a tax hike today will make them feel poorer overall and they will cut consumption. This is what I mean by non-Ricardian effects.