With the market trading near multiyear lows, bargain-hunting investors have rushed to take advantage by adding to their portfolios. But if you prefer to use mutual funds rather than individual stocks to invest, there's one expensive mistake that you'll want to be sure to avoid.

By law, mutual funds have to distribute the dividends and capital gains they accumulate over the course of each year. While some funds pay out their dividend income in quarterly installments -- the same way that they receive dividends from the stocks they invest in -- nearly all funds save up the bulk of their capital-gains distributions to pay out until just before the end of the year.

The problem with those distributions is that you'll typically have to pay income tax on them. And it doesn't matter whether you've owned shares of the fund for 15 days or 15 years -- you'll still bear the same tax burden.

Long-term gain, short-term pain
You might be surprised that there are mutual funds out there with any gains to distribute. It's pretty difficult to find stock funds with positive returns this year -- a quick check of large-cap funds on Morningstar turned up absolutely none.

Nevertheless, several funds that sold long-term winners this year do have gains to distribute. Here are a few funds that planned to make distributions as of yesterday:

Fund

Estimated Distribution (% of Net Asset Value)

Stocks With Above-Average Returns Among Top Holdings

Washington Mutual Investors Fund (AWSHX)

$0.44 - 0.54 (2-3%)

Abbott Labs (NYSE:ABT), Wells Fargo (NYSE:WFC)

Vanguard Health Care Fund (VGHCX)

$8.07 (8%)

Amgen (NASDAQ:AMGN), Abbott Labs

Vanguard PRIMECAP Fund (VPMCX)

$3.65 (8%)

Amgen, Marsh & McLennan (NYSE:MMC)

Fidelity Select Energy Portfolio (FSENX)

$2.85 (10%)

Southwestern Energy (NYSE:SWN), Petrohawk Energy (NYSE:HK)

Sources: American Funds, Vanguard, Fidelity, Morningstar.

Don't buy the distribution
For longtime fund investors, it's not totally unreasonable to pay some tax when you receive fund distributions. After all, you benefited from the appreciation in the fund's investments over the years, and so once the fund sells them at a profit, you can point to the positive impact those investments have had on the value of your fund shares.

When you're coming into a fund for the first time, however, you haven't had any time to see any investment gains. While others who came before you have prospered from those gains, you're stuck paying part of the price.

Doesn't seem fair, does it? Luckily, it's easy to avoid having to deal with year-end distributions.

3 ways to beat the tax man
When it comes to saving yourself the pain of paying taxes on gains you never earned, you have several choices. One simple way to avoid tax hassles is to wait until after the fund you want to invest in makes its year-end distribution. After that, you won't have to worry about tax problems until 2009.

For investors with tax-favored retirement accounts such as IRAs or 401(k) plans, there's an even easier solution -- buy shares of the funds you like inside your retirement account, if you can. That way, you don't have to worry about waiting; your account is tax-deferred, so you won't have to pay taxes on the distribution in any event.

Finally, if you don't have access to an IRA or 401(k) and also don't want to wait, you can try to find a similar fund that isn't planning to make a year-end distribution. For instance, the Vanguard health-care fund listed above has an exchange-traded equivalent, the Vanguard Health Care ETF (NYSE:VHT), that doesn't plan to make a taxable distribution of capital gains this year.

No matter which method you pick, there's no reason to pay taxes unnecessarily. By being aware of this mutual fund pitfall now, you won't have to worry about any nasty surprises when you do your taxes come April.

For more on funds and the market:

If you're in the market for good fund ideas, look no further than the Motley Fool Champion Funds newsletter service. Each month, you'll find new fund recommendations, market analysis, and other great advice that you can use to improve your fund portfolio. Best of all, take advantage of our free trial offer and you won't pay a cent for 30 days.

Fool contributor Dan Caplinger isn't expecting any big distributions from his funds this year. Marsh & McLennan Companies is a Motley Fool Inside Value pick. Try any of our Foolish newsletter services free for 30 days. The Fool's disclosure policy won't let you make a bad move.