Is It A Good Deal?

I keep seeing all these ads saying if you learn how to buy foreclosed homes you can get really good deals and make a lot of money by turning around and selling them for more money on the real estate market. How can you tell if a foreclosed property is really a good deal or not? Normally the home buying process involves a lot of time, you can look over the property beforehand, and you can have a home inspector come and check it out to make sure it is in good shape. Is any of this possible with foreclosed homes?