Buying a foreclosed home is a bargain at times, it depends on what phase of the foreclosure you purchase the house.
The phase you are speaking of is when the property owner did not bring the mortgage current and it did not sell at the auction, hence now called a REO (Real Estate On-hand.)
Once all the legal paperwork is completed and the property has legally transferred to the lender, they assign the property to a lender to sell for them.
At this point you are simply purchasing a house as you would from a person that listed it with a real estate office.
You will have to come up with the funds to close, by getting a loan from another lender. In a few instances the current lender might finance the property for you. There are the government lenders also FHA and VA.
The other way is purchasing at the forelcosure auction. In order to bid on this property you must normally have all cash and be able to prove it in order to bid. If you are the highest bidder, the lender will sign the property over to you. There is a few days of waiting for this to happen.
The best way, in my opinion, is to purchase directly from the current owner. It takes a little skill to do this. You have to figure out if you have a good deal or not.
You have to give the owner something to move, bring his mortgage current, see if there is any damage to the property or qualify for a new mortgage, but you can normally pick the property up a little cheaper.
I hope this has been of some use to you, good luck.