Suppose you're fortunate enough to sit on the board of a large and highly successful company like Wal-Mart Stores (NYSE:WMT), one of many companies generating more cash flow than it can earn a reasonable return on. While this is a happy position to be in (compared to being on the board of a company headed for bankruptcy), you also have a problem that must be solved. What are you going to do with the mounds of cash coming in every year?

Two bad choices
This type of company typically has four options. The first is to keep investing in dubious growth ventures. This one is the big mistake that is commonly made. The company wants to maintain a high stock price and P/E multiple, which means growth at any cost. All too often this leads to failed acquisitions or attempts at diversification that ultimately destroy shareholder value.

The second option is to pay down debt. While this may sound attractive, it's frequently not the right answer. Debt is the cheapest form of capital -- far less costly than equity. Companies with large cash flow can afford to (and should) maintain a reasonable level of debt in their capital structure, kind of like the old saw that bankers only lend money to people who don't need it. Paying off debt for this type of company only increases the cost of capital, which can also destroy shareholder value. I won't go into theory as it may bore the majority of readers, but if you're so inclined, here are some good overviews of capital structure and cost of capital.

Why dividends don't cut the mustard
This leaves you, the board member, with two rational choices -- dividends or share repurchase. Corporate finance used to favor the dividend route because it's easy. Similar to the Nike (NYSE:NKE) slogan of "Just Do It", why not just give the money back to the shareholder in the form of cash? This solution appears very intuitive, and you're not likely to get kicked off the board for suggesting it.

But dividends don't cut the mustard for three reasons. First, they're very inflexible for the company. What if Wal-Mart suddenly saw a golden opportunity to acquire Carrefour, the most successful foreign operator of hypermarts, at a great price? This is an acquisition that could add tremendous value for Wal-Mart shareholders. (It's not likely to happen, by the way.)

Sorry, can't afford it, because we're giving all our excess cash back in the form of dividends. So why not cut the dividend? Sorry, can't do that, because everyone knows only companies in financial difficulties cut dividends.

Dividends are also tax-inefficient, as they create current-year tax consequences for shareholders who invested in the stock for long-term capital gains. Microsoft (NASDAQ:MSFT) got in a situation in 2004 where it had built up so much cash it had to give it back to shareholders. The $3 per-share special dividend (over $30 billion in total) was mostly recognized as personal dividend income by individual shareholders in December 2004. This created an enormous tax windfall for the U.S. Treasury. I have nothing against paying taxes, but at least Microsoft had the foresight to announce it well in advance, allowing shareholders to decide whether they wanted a huge dividend, only to turn around and send a third of it to Uncle Sam.

Finally, I don't favor large dividends because they create a hybrid security. If I want an investment that generates current income and whose value fluctuates primarily with changes in interest rates, I should invest in bonds.

Shar e repurchase is the pure answer
Which leaves our intrepid board member with the most efficient and "pure" vehicle to return excess cash flow to shareholders -- a stock buyback. It has no unfavorable tax consequences. It's completely flexible, as the company can repurchase more or fewer shares from year to year, based on available investment opportunities.

Buybacks create shareholder value by increasing current-year EPS and future-year EPS growth rates by lowering the share base. I like buybacks because they're what a stock is all about -- ownership in future cash flow per share.

And while there are loads of incorrect myths about share repurchase (like the company is signaling its share price is low), buybacks are truly the most intuitive approach. A young company needs capital to fund growth, so it issues shares. A mature company no longer needs all that capital, so it buys back shares.

One example of a company that understands this is AutoZone (NYSE:AZO). For the past three years, sales growth has only been 9% because its industry segment is near saturation. Cash flow from operations has averaged $700 million annually, with only about $250 million annually in effective capital investments. By using the excess cash flow to repurchase shares, the company has been able to generate three-year EPS growth of more than 40%. I wouldn't mind being the only shareholder left standing in this company, in about 10-15 years at the current rate. Five hundred million of annual free cash flow would pay for the groceries quite nicely.

For more thoughts on share repurchase, check out:

You're not done yet! Read the other arguments and then vote for a winner.

Both Wal-mart Stores and Microsoft are Inside Value selections. Try this market-beating publication free for 30 days.

Fool contributor Timothy M. Otte surveys the retail scene from Dallas. He welcomes comments on his articles. Timothy owns shares of Wal-Mart, but none of the other companies mentioned in this article. The Fool has a disclosure policy.