When Merck & Co. Inc. announced earlier this month that it planned to buy back $15 billion in common stock, it seemed likely that the move would follow the typical pattern: big talk, but little actual repurchase activity for months, if not years.

Then the pharmaceutical company, with major operations in Montgomery County, struck an accelerated share-repurchase program with Goldman, Sachs & Co. last week to buy about $5 billion worth of Merck common stock. Also, Merck agreed to sell $6.5 billion in debt to raise cash to buy more shares, putting it well on the way to repurchasing shares worth $7.5 billion within the next 12 months.

"In most cases, it's hard to trace the exact use of borrowed funds to repurchase shares, but this time it is a crystal-clear transfer of value from bondholders to shareholders," Carol Levenson, a bond analyst with Gimme Credit, said in a note to investors.

Why buy back stock when a company could raise its dividend, acquire a competitor, or reinvest in its business? Financial analysts say share repurchases can be a good way to return cash to shareholders because they boost earnings per share.

Buying shares on the open market is more flexible than dividends because companies are not obligated to carry through with the repurchase plan. Dividends are locked in every quarter, and woe to the company that cuts or eliminates that payment.

Merck's mega-stock repurchase is but one of many in what is turning out to be very active year for buyback announcements. Birinyi Associates Inc. counted $208 billion in buybacks in the first quarter, putting 2013 on pace to top the record year of 2007. The second-quarter tally will include Apple Inc.'s $60 billion buyback - the biggest ever - in April.

Among companies on the Philly 50 list, Comcast Corp. said in February that it would repurchase $2 billion worth of common stock this year. In December, DuPont Co. said it would use the proceeds from the sale of its Performance Coatings business to the Carlyle Group to fund a $1 billion share-repurchase plan.

Unisys Corp., also in December, said it would buy back $50 million worth of its common and preferred stock through the end of next year. Last week, the board of SEI Investments Co. increased its stock-repurchase program by $100 million. Since the start of 2013, the Oaks financial-services firm has bought back 1.8 million shares at a cost of $52.2 million.

Given that the Standard & Poor's 500 index is up 25 percent over the last year and that many companies' stock prices are trading near 52-week highs, is this really the best time for companies to be buying?

Probably not, but various studies have found that buyback announcements surge during bull markets and lag during bear markets.

That's right, companies tend to follow the herd just like the rest of us.