Editor's note: An earlier version of this story incorrectly implied that Luminent has filed for bankruptcy, which it has not. The Motley Fool regrets the error.

If you watch the market closely enough, sometimes you can take the pain experienced by big companies and apply the lessons to your own portfolio. Take, for example, the current housing situation. In the midst of all the discussion about the various factors that have served as brush for this wildfire, you can learn an important lesson about one of the main culprits responsible for today's situation: margin.

Sure, subprime loans contributed to the housing mess. But it was the use of margin that acted as a real accelerant. Real estate investment trusts like Accredited Home Lenders (NYSE:LEND), Luminent (NYSE:LUM), and the infamous hedge funds at Bear Stearns (NYSE:BSC) are a great example. Some of these companies didn't even lend to the subprime sector, but some were forced into bankruptcy by the aftereffects. These were huge companies that borrowed in the short-term market to make loans in the long-term market. When you hold liabilities that are short-term in nature, you need to roll them every few months, and amidst a halt in the credit markets, that was impossible to do. As a result, lenders like Citigroup (NYSE:C), Goldman Sachs (NYSE:GS), and Bank of America (NYSE:BAC) called in their loans, and these companies essentially had to sell their assets at rock-bottom prices to satisfy those loans.

Margin and your portfolio
It has been argued that the stock market is one big casino. I would dispute this view in most cases, but it's hard to argue that margin isn't one of those instruments that turns the market into the Wynn Casino -- and the worst part about margin is that you, like Accredited and Bear, are playing with house money.

Let's examine how margin plays in your portfolio: Say you have $10,000 cash in a margin-eligible brokerage account. And you really think that Amazon.com, with its beefed-up service offerings and grocery delivery service, is finally going to become that cash-generation machine everyone's been waiting for. With a margin account, you can take a loan against the $10,000 in your account and borrow up to $5,000 more, giving you $15,000 to purchase shares -- in other words, you have buying power of $15,000. Depending on the security of the level of margin, actual buying power can vary.

So you load up on $15,000 worth of Amazon stock, and bang! People just can't get enough of ordering Cheerios online. The stock jumps 40%, boosting your account to $21,000. Say you decide now is the time to book your gains -- you're sitting on $11,000 in returns. After paying the brokerage the $5,000 principal amount borrowed, $6,000 of that $11,000 is yours to keep (minus the interest you pay on the amount borrowed). This is almost 50% more than what you would have made on Amazon if you'd just put that $10,000 in your account to work. Now that's buying power.

OK, now wipe the drool from your lip -- this is only a theoretical illustration. Let's look at when that buying power can be anything but powerful.

Maybe consumers find that buying Cheerios on Amazon isn't all that great of an experience -- your bet is wrong, and Amazon tumbles 20% instead. Your margined $15,000 dwindles to $12,000. Reports are coming out that things might get worse, so you decide to cut your losses. You pay back the $5,000 you borrowed, leaving you with $7,000 (less fees and interest). Sure, that hurts, but at least you have $7,000 left to wipe away your tears, right? Not so fast.

When you sign up for a margin account, no matter the broker, you are asked to sign a margin agreement. If ever there was a contract that you should read carefully before tossing into your kitchen drawer next to the Chinese food menus and DVD manuals, it's this one. In a nutshell, here is what the contract says: "If your account falls below our maintenance requirement, it will trigger a margin call. Just send us more cash to bring your account back up to necessary levels. Don't have enough cash or can't get it to us in time? No problem, we will just sell some securities in your account. Yeah, that whole asking thing? You should have read the part of the contract that says we don't have to."

Margin requirements could force a liquidation of your remaining assets, possibly without your consent: game over. So yeah, while you don't have to worry about casino enforcers taking you to a dimly lit back alley to discuss your loss of house money, you do have to agonize over coming home to your significant other after getting a margin call from your broker. (I'm sure many of you would take the enforcers any day.)

In our Amazon example, if the stock had declined even more than 20%, you could have been exposed to a margin call. When this happens, the brokerage will sell your stock at the best prevailing price. The point is that with margin, not only do you have to get the direction of a stock right, you have to make sure that the volatility stays within certain bounds -- and that, as the current market demonstrates, is hard to do.

History is littered with examples where brokers didn't play nice when enforcing margin calls, two of which are the market crash of 1929 and the wake of the technology bubble. As well, Long Term Capital Management's epic fall from grace was due in large part to gluttonous amounts of margin being called -- and LTCM had three, count 'em three, Nobel laureates. If three Nobel Prize winners couldn't do it, do you think you can?

So, in case you haven't gathered this by now, I am generally against using margin. While you might ultimately be right about the future prospects of stock in the long term, when you hold margin, it's the short term that matters. Many hedge funds, mortgage lenders, and others who borrowed short and lent long are now sitting bankrupt. Goldman Sachs' famed quant funds were down 30% because of the use of margin.

For my money, I'll sit on the sidelines and let others dabble in playing with fire by using margin. Sure, I could dabble in margin when I really like some ideas. But I'd rather wait until others' use of margin leads to a situation where stocks are available for pennies on the dollar. That idea electrifies me far more than betting the farm -- and possibly losing.

For further related Foolishness:

Bank of America is an Income Investor pick. Take a free 30-day trial and see what other recommendations the Income Investor team has uncovered.

Fool contributor Rimmy Malhotra is a New York City-based money manager. He owns shares of Bank of America and Citigroup. He welcomes your feedback. Amazon.com is a Stock Advisor selection. The Fool has a disclosure policy.