The S&P 500 (^GSPC 1.04%) has had an exceptionally good year in 2013, rising more than 25% as the bull market extends toward its fifth full year of gains. But those overall gains haven't stopped many companies from investing spare cash in their own shares, and several companies have spent enough on share repurchases to soak up a tenth or more of their entire market capitalizations. Let's take a closer look at Viacom (VIAB), Yahoo! (NASDAQ: YHOO), Halliburton (HAL -0.34%), and NVIDIA (NVDA 4.88%) to see why they're making big buyback moves.

Stock

Amount Spent on Share Repurchases, Past 12 Months

Repurchases as Percentage of Market Cap

Viacom

$4.66 billion

12.9%

Yahoo!

$4.56 billion

11.3%

Halliburton

$4.39 billion

10.5%

NVIDIA

$950 million

11.1%

Source: S&P Capital IQ. Figures are for last 12 months as of most recent financial information available to S&P Capital IQ.

Are these buybacks smart?
The reasons for these stock repurchase actions are as diverse as the companies themselves. For Viacom, most of the repurchase activity came in the September quarter, with the media giant spending $2.57 billion on its shares. That's consistent with the company's decision back in August to double its stock repurchase program authorization to $20 billion, with Viacom having said that it would accelerate its buybacks by buying an extra $2 billion above its ordinary pace. What's clear from the move is that Viacom has benefited greatly from the huge amount of cash flow that the media industry has been able to generate, as demand for high-quality content pits media giants against each other yet offers rewards to players throughout the sector. Viacom's buyback signals its belief that those favorable conditions will last for the foreseeable future, making its stock a smart buy in the company's eyes.

For Yahoo!, the biggest buybacks came at the end of 2012 and in the most recent quarter. One of the biggest transactions involved Yahoo! buying out 40 million shares of hedge fund Third Point's position in the online company's stock, as Yahoo! spent $1.16 billion on the repurchase agreement. Yet just last month, Yahoo! said that it would boost its share buyback by $5 billion. Given that the company's repurchases have reduced the number of shares outstanding by 15% already, Yahoo! has gotten a big boost to per-share earnings as a result of its accretive purchases -- especially as share prices have soared in light of CEO Marissa Mayer's efforts.

Halliburton's repurchases have come recently, with a 68 million share purchase for $3.3 billion in August. The interesting thing about the repurchase is that it came in a modified Dutch auction, in which shareholders offered more than 100 million shares at various prices. Combined with a $1 billion repurchase in the second quarter, Halliburton clearly sees its shares as being undervalued. With the company having taken steps to settle its liability in the Gulf oil spill, Halliburton could well be in an even better position in the future to return more capital to shareholders.

NVIDIA actually announced a fairly controversial buyback move last month, with plans to borrow $1.3 billion for the express purpose of funding a $1 billion capital return program in the coming fiscal year composed of dividends and buybacks. Essentially, because NVIDIA has substantial cash outside the U.S., borrowing is the best way to avoid repatriation taxes while making money available to return to shareholders. With high hopes for its graphics processing units and virtualization-supporting graphics cards, NVIDIA just might have turned a corner toward future growth.

Be smart about buybacks
Many investors worry that buybacks indicate companies being wasteful with their money. But in some cases, spending money on stock makes sense -- especially if the stock continues to climb.