During the 1990s bull market, the prize for the most outstanding mutual fund might have gone to Vanguard 500 Index Fund (VFINX), the granddaddy of all index funds. During the 10 years ending in 1999, Vanguard returned 18.07% annually and outperformed most actively managed funds, according to Morningstar.

But in the difficult markets of recent times, S&P 500 index funds have sputtered. For the 10 years ending in September, Vanguard 500 returned 2.99%, a middling showing.

For this decade, the prize for outstanding performance might go to a fund like CGM Focus Fund ( CGMFX), which returned 25.95% annually over the past 10 years.

The difference between Vanguard 500 and CGM is stark. While S&P funds buy and hold the 500 large stocks of the benchmark index, CGM is flexible, wandering all over the map. Portfolio manager Kenneth Heebner takes whatever stocks seem likely to benefit from economic trends. He takes stocks of all sizes, sometimes betting on declines by selling short. In the erratic markets of this decade, CGM's ability to turn on a dime has provided an edge.

When the S&P fell in 2000, Heebner shorted technology stocks and returned 53.9%. The next year, he bet on a recovery in housing stocks and outperformed the index by more than 50 percentage points. In 2007, Heebner returned 79.97% by buying mining companies and shorting financial stocks.

While CGM may be winning plaudits lately, the fund received little praise in the 1990s. At the time, Heebner trailed the benchmark S&P 500, and many financial advisors sneered at the flexible fund's investing style. Advisors said that CGM drifted, buying small domestic stocks one month and large foreign issues the next. The advisors preferred what are called style-pure funds, which focus on one category, such as small value stocks.

In the bull market, the pure funds seemed unbeatable. Portfolio managers who bought and held large blue-chip stocks scored huge gains year after year. Based on the results, some academic studies concluded that pure funds were superior. Advisers concluded that the style-pure funds were disciplined and more sophisticated than the flexible choices.

But funds like CGM lagged partly because they often hold cash, which drags down returns in a bull market. When stocks fell recently, the cash provided a cushion. That helped many flexible managers outperform pure funds, which often stay fully invested in stocks.

Despite the success of CGM, many financial advisers continue to favor style-pure choices. Should investors avoid flexible funds? To find out, Morningstar compared long-term returns of pure and flexible funds. The study concluded that both categories produced about the same results. "There is no reason to think that flexible funds will do worse," says John Rekenthaler, vice president of research for Morningstar.

Style-pure funds do have an advantage for those who seek to control their asset allocations closely. An investor who wants to put 20% of assets in large growth stocks can accomplish that easily by picking a pure fund. If you buy CGM, you can never predict what percentage of holdings will go into growth stocks.

Rekenthaler says that it is fine to hold portfolios constructed of all pure funds or all flexible ones. But some investors may want to include both. To keep a handle on asset allocations, John Sterba, a financial adviser in New York, keeps most of his assets in pure funds. But he often includes a flexible fund or two. "If you hold a good flexible fund, you may be able to boost returns a bit without throwing off your asset allocation much," he says.

Some of the top-performing flexible funds own broad portfolios, including growth and value shares, as well as stocks of all sizes. Because of their diversification, the funds can prosper in a variety of market conditions. A strong choice is Hodges Fund ( HDPMX), which returned 7.74% annually over the past 10 years.

Hodges kept most of its assets in small stocks during 2002, a year when big issues trailed. More recently, the fund has been shifting to big stocks, figuring that investors will turn to safe blue chips in the bear market. "We try to own sectors that are in favor with the market," says portfolio manager Craig Hodges. "If you just own small-caps, then you are guaranteed to have stretches when your performance will be poor."

Another top performer is Thornburg Value ( TVAFX), which returned 6.18% annually during the past 10 years. Portfolio manager William Fries holds a mix of stocks that includes blue chips with growing earnings and bargain-priced value names. Now that many blue chips have been battered, he is scooping up familiar names, such as Microsoft ( MSFT). "Companies with high returns on equity and strong market niches should hold up in difficult times," he says.

Nobody ever made a dime by panicking, says Jim Cramer. Moneymaking opportunities exist despite the market turmoil. So where's a market master like Cramer putting his money these days? Check out his personal portfolio at Action Alerts PLUS. Take a free trial now.

Stan Luxenberg is a freelance writer who specializes in mutual funds and investing. He was formerly executive editor of Individual Investor magazine.

More from Personal Finance

'Worn-out' Shoemakers Still Have a Chance to Heal

'Worn-out' Shoemakers Still Have a Chance to Heal

Summer Travel: The Best Places to Visit in the U.S.

Summer Travel: The Best Places to Visit in the U.S.

9 Best Investment Books for Beginners

9 Best Investment Books for Beginners

How to Calculate Your Net Worth and Pin Down Your Financial Health

How to Calculate Your Net Worth and Pin Down Your Financial Health

The Best States for Millennials' Money and Health

The Best States for Millennials' Money and Health