Nobody likes to make an investing mistake. But inevitably, you'll lose money from a bad investment. When you do, taking advantage of capital loss carryovers can help you earn back a good portion of what you've lost.

Making the best of a bad situation As we approach the end of the year, many investors are already aware of the tax-loss harvesting strategy. By selling stocks that have lost value, you can lock in capital losses that you can use to offset income on your 2012 tax return.

Unfortunately, though, there's a limit to the amount of capital losses you're allowed to use. You can claim capital losses up to the full amount of any capital gains that you have, effectively offsetting all of your profitable positions. Beyond that, you can use up to $3,000 of additional capital losses against other sorts of income, including interest, dividends, and even non-investment income like wages.

But as many investors found out during the bear market year of 2008, you'll sometimes have losses that exceed your gains by more than that $3,000 limit. That's where the rules governing capital loss carryovers apply, letting you reap tax benefits in future years.

How to carry over your capital losses Figuring out how much of your losses you're allowed to carry over to future years is relatively simple. Basically, if you have losses left after you offset any capital gains in a given year and after you use up to $3,000 to offset other income, you're allowed to carry them over to the following year.

There's no limit on how many years you can use capital loss carryovers. Therefore, if your losses are large enough, then it may take several years to go through all of them even if you have subsequent gains on other investments.

Being smart with capital loss carryovers In order to make the most of your losses, you should consider some of the more technical aspects of the rules governing capital losses and gains. Most of them hinge on whether the capital losses in question are short-term or long-term.

Short-term losses come from stocks you've held for a year or less. If you own a stock longer than a year, then any losses on their sale are treated as long-term losses. Because long-term capital gains tax rates are lower than rates on short-term gains, short-term losses can bring you more tax savings -- if you're smart about using them.

That means that if you bought a stock last November or December that has lost a lot of money, you should strongly consider selling it now rather than later, before your losses get treated as long-term. Coal stocks are a prime example, with Alpha Natural Resources (NYSE: ANR), Peabody Energy (NYSE: BTU), and CONSOL Energy (NYSE: CNX) all having posted losses of 25% to 75% since late 2011 due to weak coal demand stemming from low natural gas prices and slowing economic growth in coal-hungry markets like China. Solar stocks have been under similar pressure, with First Solar (Nasdaq: FSLR) and SunPower (Nasdaq: SPWR) among the many companies in the industry that have seen major share declines due to big losses and a glut of products.

Dealing with intricacies But there are exceptions to that rule that require some sophisticated planning. If you have a lot of gains from short-term holdings but no corresponding long-term gains, generating long-term losses gives you an unusual but valuable opportunity. The tax law lets you offset net long-term losses against short-term gains. That can save you an even larger amount because of the higher rates that typically apply to those gains.

Conversely, if all you have are long-term gains, you may want to hold off on harvesting short-term losses. That's because the same tax law requires you to offset net short-term losses against long-term gains. That essentially wastes your valuable short-term losses on gains that wouldn't have cost you as much on your tax bill.

Be smart Capital loss carryovers are a silver lining that cushions the blow of a big loss. By knowing the tax rules, you can ensure that you'll make the most of carryover opportunities whenever they arise.

First Solar has produced some pretty big losses over the past year, but things may be turning around for the company.