Tax-favored retirement accounts are a great way to save for one's golden years. But when people die before using up all of their IRA money, their heirs could be the ones left to pay off the tax man. How much you pay in income tax when you inherit an IRA generally depends on what type of IRA it is and what your own tax bracket is.

Traditional vs. Roth IRAs
The general rule for retirement accounts is that as long as the money stays within the IRA, no one owes any taxes on it. Once you make withdrawals, though, that's when the IRS can come to collect its fair share -- if it's the right kind of IRA.

Specifically, the same rules governing taxes on IRAs that apply to the original owner also apply to heirs. For a traditional IRA, the heir will have to count withdrawals as taxable income in the year in which the money comes out of the account. For a Roth IRA, on the other hand, withdrawals are tax-free, whether it's the original owner or the heir after the owner's death taking the money out of the account.

When do you have to pay?
For inherited IRAs, the biggest question is how quickly you have to take money out -- and therefore end up potentially paying tax on the withdrawals. The answer depends in part on whether you're the spouse of the deceased person or not.

Spouses have the special right to roll over an inherited IRA into an IRA in their own name. If they do so, then any minimum distribution rules are based on the surviving spouse's age. Alternatively, spouses can choose to follow the rules governing non-spouses if they prefer.

Those who aren't surviving spouses typically have two options. One choice involves withdrawing the entire balance of the inherited IRA within five years of the date of death. The other allows the heir to take minimum withdrawals each year based on their life expectancy as of the date of death. This second method allows heirs to stretch out distributions throughout their own lifetimes, which is why this form of inheritance is sometimes called a stretch IRA.

As you can see, figuring out exactly how much in tax you'll pay on an IRA inheritance is more complicated than simply running numbers through a calculator. Although heirs can choose to withdraw all the inherited IRA money immediately after the death of the person who left the IRA to them, using other strategies for IRA withdrawals can reduce your tax bill and defer your having to pay the IRS for years into the future.

The $15,978 Social Security bonus most retirees completely overlook
If you're like most Americans, you're a few years (or more) behind on your retirement savings. But a handful of little-known "Social Security secrets" could help ensure a boost in your retirement income. In fact, one MarketWatch reporter argues that if more Americans knew about this, the government would have to shell out an extra $10 billion annually. For example: one easy, 17-minute trick could pay you as much as $15,978 more... each year! Once you learn how to take advantage of all these loopholes, we think you could retire confidently with the peace of mind we're all after. Simply click here to discover how you can take advantage of these strategies.

This article is part of The Motley Fool's Knowledge Center, which was created based on the collected wisdom of a fantastic community of investors based in the Foolsaurus. Pop on over there to learn more about our Wiki and how you can be involved in helping the world invest, better! If you see any issues with this page, please email us at Thanks -- and Fool on!

Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.