The article zorg1000 linked to gives a very good description.
The article kind of says this indirectly, but the main reason to buy back stock is to reward current shareholders. A company can reward shareholders in two ways: dividends or increases in stock price (through buying back shares). Either way the shareholder gets more value for their shares. I suppose the other big advantage is that they get a good price on their stock if they think it is undervalued. Perhaps a company would prefer to release the money as dividends if they think their shares are correctly valued or overvalued? That makes sense to me. Either way they are rewarding their shareholders though.