I think for many of us, the arduous path to retirement is similar, metaphorically speaking, to that long road we took to the beach as children, the endless stretch of concrete that separated us from a long-awaited summer vacation. Then, and now, we sometimes encounter wrong turns, potholes, and flat tires before we reach the finish line, along with the timeless question: "Are we there yet?"

Before we take that last exit that leads to the water's edge, when the hectic 9-5 (or 6, or 7) workweek is finally replaced with life's more leisurely pursuits, a few financial affairs must first be squared away. First and foremost, for many, is what to do with that 401(k) or other employer-sponsored plan that has been taking a bite out of our paycheck for so many years. Simple; just roll it into an IRA at T. Rowe Price (NASDAQ:TROW) or A.G. Edwards (NYSE:AGE) and let it continue to grow tax-deferred, right?

Not so fast. It's a complicated question, the likes of which Robert Brokamp tries to answer all the time in the Fool's Rule Your Retirement newsletter service. But let's take some time here to look at it from different angles.

While that rollover is a good move for most, those with a substantial amount of highly appreciated company (i.e., employer) stock may have a better option. To demonstrate, let's meet two workers who are about to punch the clock for the last time and finally enjoy the fruits of their labor.

Meet the contestants
First is Mr. Johnson, who has worked at Exxon Mobil (NYSE:XOM) for 30 years and has accumulated a tidy pile of 2,500 Exxon Mobil shares inside his 401(k), which are worth around $112,500 at the current price of $45. As he began investing long ago, he paid an average of only $20 per share, for a cost basis of $50,000. We'll say that Mr. Johnson is in the 33% tax bracket and wants to purchase a fishing cabin in Colorado as a summer retreat for his family.

At the same time, Mr. Johnson's cousin, Mr. Briggs, is about to leave the workforce after a 30-year career with Coca-Cola (NYSE:KO). Mr. Briggs is also in the 33% tax bracket, with his eye on a secluded chalet in the Rocky Mountains where his family can ski in the winter. During the tenure of his employment, he also acquired 2,500 company shares, also at a $20 average price. With Coca-Cola also trading at $45, the shares, like his cousin's, have a $112,500 market value.

After doing his homework and consulting a tax advisor, Mr. Johnson decides to take a lump-sum distribution of his 401(k) into a taxable account. Taxable? Surely that was a typo -- who would willingly forgo tax-deferred growth? But a trick -- called the net unrealized appreciation (NUA) strategy -- allows Mr. Johnson to pay taxes (for now) on only the $50,000 cost basis and not the full $112,500 market value of the stock. No need to worry about that $62,500 gain until he decides to sell the stock.

Mr. Briggs goes the standard route. He decides to roll over his entire 401(k) into an IRA account, knowing that no taxes will be due until a distribution is taken in the future.

And the winner is...
One year in the future, they spot the perfect cabin, nestled on the shores of an alpine lake, within driving distance from several ski resorts. It's listed for sale at $250,000, which neither can afford outright. They decide to split the price evenly, a logical solution considering one family intends to use the vacation home in the winter, the other primarily in the summer.

To cover his half of the purchase price, Mr. Briggs liquidates his Coke shares, which have appreciated from $45 to $50 since he rolled them into an IRA a year ago. With a 33% income tax rate, selling the shares (now valued at $125,000) will trigger a $41,250 tax bill.

The same day, Mr. Johnson sells his 2,500 shares of Exxon Mobil, which have also jumped $5 higher since the day he exited the 401(k). Having already paid income taxes on the $50,000 cost basis, he needs only cover the gain. However, and this is the key, the $75,000 appreciation is subject to capital gains taxes of 15%, not ordinary income taxes of 33%.

In total, Mr. Johnson paid $16,500 in taxes ($50,000 x 33%) when he first moved the company stock into a taxable account, and another $11,250 ($75,000 x 15%) upon later sale of those shares. So Mr. Johnson ends up with an overall tax bill of $27,750, which is $13,500 less than his cousin's.

The NUA strategy
By employing the NUA strategy, high ordinary income taxes on stock gains can be replaced with much lower capital gains taxes. Keep in mind, though, that NUA applies only to employer stock.

Here's how it works: A retiring worker takes a lump-sum distribution of his plan, which is transferred to a brokerage account in kind. Mutual funds and other assets are then subsequently rolled over into an IRA, leaving only the company stock in the taxable account. The only taxes paid at this point are ordinary income taxes on the investor's cost basis in the stock. The rest are deferred until that stock is actually sold.

It helps to think of three separate, taxable "blocks" at play in the NUA strategy. The first block is the cost basis, which is taxed at ordinary income rates at the date of distribution.

The next block, the NUA itself, is the difference between the cost basis and the market value at the date of distribution. Although it's defined at the distribution date, it's not actually taxed until the eventual sale. It's always taxed at the long-term capital gains rate.

Finally, there's the additional appreciation (if any) of the company stock that occurs between the distribution and the sale. This final block is taxed at either short-term or long-term capital gains rates as appropriate.

Other advantages
Although I won't get into the details here, an NUA strategy also has big advantages if company shares are gifted (to either people or charities) or passed on to beneficiaries.

Many good resources -- a tax advisor being the most obvious -- exist for further exploration of the NUA strategy. If you answer "yes" to the following questions, the NUA approach may work especially well for you:

  • Do you own a lot of highly appreciated company stock?

  • Will you avoid an IRS 10% premature distribution penalty?

  • Are you in a high tax bracket?

  • Can you cover the taxes triggered by the initial distribution?

Of course, there are other questions to sort through. Are there any after-tax contributions involved? What about state income taxes? What if the stock falls instead of rises? How will dividends impact the scenario? Will I need to diversify these assets?

The NUA strategy is not for everyone, but it can be helpful under the right circumstances. Obviously, the larger the unrealized gain in your stock and the higher your tax bracket, the more you stand to benefit.

And speaking of good resources, both Merrill Lynch (NYSE:MER) and Citigroup's (NYSE:C) Smith Barney have excellent overviews available here and here. I'd recommend that anyone approaching retirement age consult a professional; mistakes in this game can be costly.

As I mentioned above, the Fool also has a great newsletter service for folks approaching or already in retirement. If you'd like to Rule Your Retirement, check it out -- for free.

Fool contributor Nathan Slaughter would like to retire at 35, but the numbers don't look promising. He owns none of the companies mentioned. The Motley Fool has a disclosure policy.