I recently decided to start looking for future survivors in the subprime mortgage sector. Stock prices of Accredited Home Lenders (NASDAQ:LEND), New Century (NYSE:NEW), NovaStar (NYSE:NFI), and IndyMac Bancorp (NYSE:NDE) have cratered, absolutely cratered, and nearly every pure-play subprime mortgage lender is priced as if it's going out of business. There's a lot of truth to the negativity surrounding subprime mortgages -- many have already gone out of business (or sold themselves), and many more probably will.

However, whenever an entire sector is painted with the same brush, there's opportunity. The biggest problem seems to be credit quality -- billions and billions of dollars' worth of loans were made that simply made no sense. Stated documentation (when the borrower can basically make up numbers if he or she chooses), interest-only, and negative-amortization loans are simply haphazard and for the most part should not be made.

Subprime cycle
So why were they made? For a while, making these questionable loans was a fantastic business. Gross premium gains on sales of loans shot up to the 4% range -- after subtracting expenses, some lenders were making a net 2% on loans sold, and on $10 billion, 2% is a whopping $200 million. How would you like to make $200 million just by originating a bunch of questionable loans and selling them to yield-hungry, unsuspecting investors? It's like a game of hot potato -- as long as the potato isn't in your hands at the end, you're good.

For a while, things were good -- subprime lenders were happy because they were getting fat premiums, Wall Street business (which provided the securitization services) was booming, and investors in these securitized loans were happy because yields were high and defaults were low. Such is life when interest rates are low. The housing boom masked underlying problems because people who couldn't pay for their mortgages could either roll over their loans or sell them at a gain. Thus, the subprime machine worked for a while.

Oops, I did it again
However, trees don't grow to the sky. Housing cooled off, which meant buyers were stuck with their houses. Thus, the ones who couldn't pay their mortgages started defaulting, which further pressured the housing market. Plus, a lot of borrowers were having their rates reset upwards, a move that increased defaults. Wall Street started getting cold feet and sending back more early-payment default mortgages, and that hurt subprime lenders badly and caused some to go under. Investors -- the ones holding the hot potatoes -- were getting hurt by a jump in default rates, which cuts directly into their yield. Thus, demand for subprime mortgages decreased, which decreased premiums, which further hurt subprime lenders.

As you can see, it's kind of a domino effect on the way up and the way down. That's why there are cycles, because the ride up and the ride down both have self-reinforcing mechanisms until something big happens and an inflection point is hit. It's kind of like the stock market, where everyone joins for a great party, which keeps getting better and better as you get drunker and drunker. Then, all of the sudden you wake up huddled over a porcelain bowl the next day swearing never to touch alcohol again.

Although I think it's pretty obvious there will be a lot of pain and suffering, I don't think every subprime lender is going to go under.

A subprime mortgage, like an insurance policy, is neither inherently good or bad: It's all about price and value. For example, after hurricanes Katrina, Wilma, and Rita, people thought the catastrophe-insurance business was the devil incarnate. The real problem was that insurance premiums didn't price the risk properly (due to faulty loss models), and guys like Warren Buffett made billions by simply waiting until pricing hardened and filling the void in capacity after the storms.

The same should happen in subprime mortgages. The people holding the shaky loans will be the ones who suffer the most. The housing market will probably suffer because some borrowers won't be able to get loans. Some originators who can't weather the storm will either be sold or go bankrupt. However, after that, the ones left standing -- like Forrest Gump's shrimping business after the storm -- will make a fortune.

Back to square one
The great thing about a free market is that it eventually self-corrects. The bad-loan poison will work its way back through the system and kill off the causes of that poison. As we've already seen, securitizers, government agencies, and investors are all cracking down hard. This forces originators to follow suit. Thus, things like stated documentation and negative amortization loans won't fly anymore. From now on, more loans that make sense and are priced properly will be made, and this will also help stabilize the housing market after the poison works its way out of the system.

In the end, my economics education taught me one very simple rule: It's about supply and demand. Previously, there was way too much unscrupulous demand for subprime mortgages. Once originators stretched the rules to provide the supply, things eventually went haywire. Now, demand is plummeting, and supply is as well (as originators shut down and cut back).

Smart investors know that fortunes are made while sifting through wreckage, so it's time to start looking for survivors. I don't know how long it will take for the poison to recede, but I do know that subprime borrowers still need places to live, and that a properly priced mortgage made on a properly priced home (even a subprime mortgage) is very valuable both to the borrower and the lender (and thus the investor). In time, there will be a balance again and the cycle will start anew.

However, I do not know when the subprime downturn will end, nor am I advising anyone to buy or sell specific subprime lenders. The sector will be volatile, and investors should do their own due diligence.

For related Foolishness:

What is Wall Street overlooking now? Inside Value gives subscribers the big names with the best prospects for good returns. A free trial gives you all the picks and how they're doing.

Fool contributor Emil Lee is an analyst and a disciple of value investing. He doesn't own shares in any of the companies mentioned above. Emil appreciates your comments, concerns, and complaints. The Motley Fool has a disclosure policy.