In addition, the company cited a lower tax rate and a $137 million gain related to refranchising its bottling operations in Vietnam - issues that one analyst said made the results look better than they are.

"The headline is much better than the net result," said JP Morgan analyst John Faucher.

Both companies' results came a week after Coca-Cola <KO.N> reported disappointing sales, blaming poor weather, and activist shareholder Nelson Peltz said that PepsiCo should buy Oreo cookie-maker Mondelez International <MDLZ.O> and split off its soft-drink business.

Despite the beat, the maker of Pepsi-Cola, Frito-Lay snacks and Tropicana juice stood by its outlook for 2013, which calls for earnings growth of 7 percent.

Net income was $2.01 billion, or $1.28 per share in PepsiCo's second quarter, up from $1.49 billion, or 94 cents per share a year earlier.

Excluding items such as restructuring and integration charges, earnings were $1.31 per share. On that basis, analysts on average were expecting $1.19 per share, according to Thomson Reuters I/B/E/S.

Sales volume rose 3 percent for the food business and 1.5 percent for the beverage business. Volume tracks the amount of product sold.

On the food side, volume in the Americas rose 2 percent. In Latin America, it gained 1 percent, while in North America, it rose 3 percent for Frito-Lay and 1 percent for Quaker Foods. Snack volume increased 3 percent in Europe and 6 percent in the Asia, Middle East and Africa segment.

On the more challenged drinks side, volume in the Americas fell 3.5 percent, was flat in Europe and rose 9 percent in Asia, the Middle East and Africa.

Like Coca-Cola, PepsiCo's drinks business was hurt by an unusually cool and wet spring, Chief Financial Officer Hugh Johnston told CNBC-TV. But the company's broad portfolio played a role in its strong performance, he said, and dismissed Peltz's notion that the company should buy Mondelez.

"We think PepsiCo as a portfolio is working so well right now and the complexity of taking on an $80 billion acquisition and somehow trying to do all that integration, frankly, will distract the business from doing what it is that we're doing right now, which is creating a lot of value for shareholders," Johnston said.

He added that when someone advocates for the deal, "more often than not it's someone who's got a bigger stake in Mondelez."

PepsiCo shares were little changed at about $86.22 in early New York Stock Exchange trading. They are up 26 percent so far this year.