The Federal Reserve has a unique power. It is the only entity that can create money out of nothing. In fact, regulating the amount of money in circulation is one of its main policy tools. If it finds that it needs to lend money to banks in trouble, in its capacity as lender of last resort, the central bank can simply lend money where none existed previously. All it needs to do is note in its books that there is now more money in existence...
So why doesn't the Federal Reserve simply wave its hands and make the economic crisis disappear? Well, it's not quite that simple. There is a price to pay for making money spontaneously appear. That price is inflation. The more money there is, the less each Dollar is actually worth. So, if you follow the logic, in reality it is not the Federal Reserve that is paying for the distressed bank loans, it is you and I. As the Fed creates more money, our savings and our earnings are worth that much less. Of course, the Fed can also work in reverse and make excess money disappear when it thinks that the economy is too hot. But I'm guessing that's not happening any time soon.
There's another form of government bail-out. The government can simply assume control of a moribound business. When nationalizing, the government becomes the owner of the business and also assumes the obligations and debts of that business. Where does the government get money to fund such takeovers? Obviously, it can use money from its budget, which we pay for with our taxes. However, the U.S. government is running a perpetual deficit (meaning it is spending more money than it is collecting in taxes). This means that to finance such acquisitions the government needs to borrow money. They do this by issuing bonds to a variety of interested parties, from ordinary citizens who purchase treasuries to foreign governments who do the same. Of course, bonds pay interest and this cost gets added to the spending which we as tax payers need to finance.
So, the bottom line: regardless of the mechanics of each bail-out at the end of the day, the tax-payer is the one that ends up paying the price. This does not mean that all bail-outs are bad, only that the person who is paying the bill is... you.