In July 2002, Worldcom filed for bankruptcy after its new leaders discovered accounting fraud nearly as egregious as the practices that had brought down Enron a year earlier. Worldcom overtook Enron as the largest corporate bankruptcy in U.S. history, with assets of $107 billion and debts of $41 billion at the time of its filing.

Its market cap peaked at $115 billion in 1999, following a spree of mergers and acquisitions. In just three years, investors were completely wiped out.

Worldcom's tragic fall was disastrous for all of its shareholders. Naturally, you may be anxious to avoid massive losses like this. But how can ordinary investors avoid becoming victims of the next accounting scam when even the professionals did not see the Worldcom scandal coming?

Inflated earnings
Worldcom quickly slid into bankruptcy after disclosing in June 2002 that it had inflated its earnings to the tune of more than $3.8 billion during 2001 and early 2002 by improperly classifying certain costs. By that time, CEO Bernard Ebbers had been ousted by the board, and CFO Scott Sullivan was tossed out as soon as the accounting improprieties came to light.

An investigation by several board members eventually found more accounting shenanigans. In total, Worldcom management had manipulated the company financial statements to boost earnings by more than $7 billion between 1999 and 2002.

From 1999 to 2000, the company improperly released $3.3 billion of expense accruals related to "line costs" -- the cost of carrying a voice call or other data from point A to point B. These accruals were reserves intended to pay other vendors for expenses that had not been billed yet. By releasing the accruals, Worldcom unjustifiably assumed those costs away.

By the end of 2000, Worldcom had run out of accruals to reverse in order to inflate its earnings. Instead, CFO Sullivan started booking some line costs as capital expenses. As a result, these costs were treated as long-term investments that would only be recognized in the income statement gradually, over a period of many years. This accounting trick added $3.5 billion to the bottom line in 2001 and early 2002.

Don't ignore cash flow
So how could investors have reduced the risk of falling victim to these scams?

The first lesson is that you cannot ignore cash flow. There is a long-running debate among investors about whether to focus primarily on reported earnings or on cash flow. While each side has reasonable arguments, this is a false dichotomy. It is important to analyze both.

By capitalizing billions of dollars in line costs that should have been booked as operating expenses, Worldcom dramatically inflated its earnings in 2001 and early 2002. But reclassifying expenses in this way cannot alter a company's cash flow.

In 2001, the "peak" year of the fraud, Worldcom reported pre-tax income of $2.4 billion. However, free cash flow -- essentially the cash earnings -- came in at just $108 million. This was an early warning sign for investors.

This is not to say that every company with net income that significantly outpaces free cash flow is cooking the books. Sometimes, it just shows that the company is investing heavily for growth. If it is clear where the money is going -- e.g. new factories, new stores, new equipment -- and the investments are driving significant growth, you probably have no reason to worry.

But if you cannot figure out what the company is investing in, you may want to step back and reevaluate your position. After all, it is better to miss an opportunity than to lose a boatload of money betting on a company you do not fully understand.

Pay attention to the fine print
The second lesson is that you need to pay attention to the fine print as much as possible. In their SEC filings (particularly the 10-Q quarterly reports and 10-K annual reports), companies are required to disclose things like changes in accruals in the "notes" section.

A long string of accrual adjustments that all go in one direction -- such as what happened at Worldcom in the late 1990s -- suggests that something fishy is going on.

Obviously, most investors are not professional accountants. Even a well-educated investor could be fooled by accounting tricks from time to time. It is still important to struggle through the notes to the financial statements to try to identify risks for any company that you have invested a significant portion of your wealth in. Thankfully, there are also plenty of resources on the Web that you can look to for help.

If you do not have the time to do this level of research, that is okay too. But then you should strongly consider investing in index funds (or ETFs), so that you have a highly diversified portfolio that will not be devastated by problems at one or two companies.

Do your homework!
While it might not have been obvious that Worldcom was running a giant accounting scam at the time, there were plenty of warning signs that careful investors could have picked up on.

By tracking free cash flow as well as accounting earnings, investors could have recognized that Worldcom's reported profits were not translating to cash and thus might be overstated. By regularly reading through the notes to the financial statements, investors may also have been able to detect its unusual pattern of accrual releases. Recognizing either of these issues would have given investors an opportunity to exit before the stock collapsed.