PepsiCo raised its full-year outlook as it beat earnings and revenue estimates for the second quarter, but higher prices hurt its volume.