Credit the booming stock market as a partial catalyst for a surge in mergers and acquisitions, which are up almost 73 percent from the same period a year ago.

In the first six months of this year alone, companies have announced deals worth nearly $2 trillion, a seven-year high. But if you want to get a piece of the action as an investor, you're best off betting on the banks that have a hand in arranging or advising the mergers––or on an even larger pool of stocks. The mutual funds that specialize in this activity are poor performers.

One of the oldest and largest funds in this niche is the Merger Fund, which manages nearly $6 billion. Over the past 12 months through July 11, the fund has returned 5.5 percent, which lags the broader S&P 500 index by more than 14 percentage points.

While the margin of underperformance to the S&P Index is 16 points over the past half-decade, the Merger Fund shows a slight advantage over the index over the past 15 years, with an annualized return of 4.5 percent.

The Merger Fund's largest holdings include some recent merger candidates such as Omnicon Group Inc, Time Warner Cable Inc and T-Mobile US Inc. Like most of the funds in this category, the Merger Fund is expensive to hold, costing 1.26 percent for annual expenses plus a 0.17 percent 12b-1 charge and transaction expenses.

A similar vehicle is the Arbitrage Fund, up about 2 percent for the past 12 months and has roughly averaged 2 percent performance for the past five years. The Arbitrage Fund is even more expensive than the Merger Fund, charging 1.45 percent in management expenses and a 0.25 percent 12b-1 fee.

Of the four largest funds in the merger category, none has come close to beating the S&P 500 Index in recent years, so you should consider a more passive, indirect strategy.

The problem with owning a merger/arbitrage fund is that its managers only focus on a handful of companies. What if the companies picked by the managers don't merge? What if the market doesn't bid up the price of the targeted company?

Many proposed deals fizzle when both sides can't make the deal work, and some take a long time to complete. Major deals still pending include AT&T Inc and DirectTV Group, and Comcast Corp and Time Warner Cable.
Deals can blow up as well. The proposed $35 billion union of Publicis Groupe SA and Omnicom would have created one of the largest advertising firms in the world, but collapsed after several months of negotiations.

When nothing happens, the fund managers can end up holding a stock that doesn't rise at all or drops in value.

Indirect Strategy

A more profitable strategy is a roundabout way of playing the merger-acquisition game. Instead of picking potential winners, just pick a handful of investment banks doing the most deals when the merger climate is hot. They profit handsomely from setting up these corporate marriages.

To zero in on the biggest background players in mergers and acquisitions, target the top five elite investment banks doing the bulk of the deals. This group would include Goldman Sachs Group Inc, Morgan Stanley, Bank of America Corp (Merrill Lynch), Citigroup Inc and JP Morgan Chase & Co.