"You make most of your money in a bear market. You just don't realize it at the time."

-- Shelby Davis

On July 9, this protracted slump officially became a bear market. Although the Dow and the S&P are both off only 11% year to date, the S&P 500 is nearly 17% off its Oct. 9 high -- and until it regains that 17% and keeps it, we'll be in the throes of a bear market.

And not just any bear market -- the legendary but embattled Bill Miller, whose Legg Mason Value Trust beat the market for 15 straight years through 2005, said in his recent shareholder letter that this was the most difficult market he's ever seen -- over and above the savings and loan crisis, the Nasdaq bubble, 9/11, or any previous recession or bear market he's worked in.

Is it time to run for the exits?
With the major indexes down and an uncertain near-term economic picture, investors have pulled money out of stock mutual funds at a rapid clip. In 2007, nearly $86 billion net was added to stock mutual funds; so far in 2008, more than $20 billion net has flown back out.

Miller himself hasn't been immune. Because of poor performance from top holdings like American International Group (NYSE:AIG), Freddie Mac (NYSE:FRE), and Qwest (NYSE:Q), his fund has sank in the past two years, and folks are fleeing -- including some high-profile institutional clients.

But that's counterproductive. As he notes:

The best time to buy our funds or to open an account with us has always been when we've had dismal performance, and the worst time has always been after a long run of excess returns. Yet we (and everyone else) get the most inflows and the most interest after we've done well, and the most redemptions and client terminations after we've done poorly. [emphasis in original]

No, really: This is the time to buy
So why should investors buy in when funds have performed poorly? Because the track record of their managers tells a different story.

See, in rough markets, even the very best investors will stumble. According to research by Davis Funds, "98% of top-quartile-performing large-cap money managers spent at least one three-year period in the bottom half of the crowd, 75% spent at least one three-year period in the bottom quarter, and 43%" -- nearly half! -- "spent at least one three-year period in the bottom decile."

For example, and according to more data from Davis Funds, Charlie Munger underperformed the market in five separate years during one 14-year stretch. His cumulative returns during that 14-year period, though, were better than a thousand percentage points higher than the S&P 500 index.

In other words, just when the market has seemingly taken a proven manager to the cleaners, it may be the time to load up. Because as we keep saying: Now is a fantastic time to be a value investor -- as long as you're thinking long-term.

And though "value investor" may have you thinking P/Es, cash flows, and catalysts, you should also be thinking mutual funds.

Take this fund. Please.
Although mutual funds haven't lost as much, overall, as has the stock market, they've still taken a serious hit. According to Morningstar, equity mutual funds as a whole are down 10.0% year to date and 7.9% in the last year -- but some of the strongest long-term funds have been hit much harder.

The aforementioned Legg Mason Value Trust, for example, is currently ranked in the 99th percentile of large-cap blend funds, and it's down 25% year to date, lagging the S&P 500 by nearly 16 percentage points. In fact, it has underperformed the market so significantly in the past three years that it's now lagging the market by a percentage point in 10-year annualized returns!

Is it time to write off Miller's 15-year streak as just luck? Definitely not.

Like other value investors, he's buying the companies he thinks are undervalued right now. Among his top 10 holdings as of June 30 were AES (NYSE:AES), Amazon.com (NASDAQ:AMZN), Aetna (NYSE:AET), and Google (NASDAQ:GOOG).

These are solid companies, but they likely won't vault Legg Mason Value Trust to the top of the heap overnight, particularly with some of the financials still dragging down the portfolio. But Miller is positioning his fund for long-term outperformance.

The Foolish bottom line
We don't know if the market will recover tomorrow, next week, next month, or next year, but I side with Bill Miller's optimistic long-term view:

[I]t is obvious the credit crisis will end, and it is obvious the housing crisis will end, and that credit markets will function satisfactorily and house prices will stop going down and then start moving higher. It is obvious that the American consumer will spend sufficiently to keep the economy moving forward long term. It is obvious that the U.S. economy, already the most productive in the world, will get even more productive and will adapt and grow. It is obvious stock prices will be higher in the future than they are now.

If you can identify fundamentally sound companies or fundamentally smart fund managers and practice patience and discipline, investing today should reward you in the long run. Given that everyone's running for the exits, Miller's fund is one worth looking into.

But there are two value funds I like even better. They also have excellent managers and an impressive long-term record; they've also been beaten down this year. Come see who they are with a free 30-day trial to Motley Fool Champion Funds. While you're there, check out our entire lineup of growth, blend, and sector-specific funds. Just click here to get started.

At the time of publication, Julie Clarenbach owned none of the securities mentioned in this article. Amazon.com is a Stock Advisor choice. Google is a Rule Breakers recommendation. The Motley Fool has a disclosure policy.