PepsiCo’s shares went up more than 3% Wednesday after the company posted strong earnings in its third quarter, beating analysts’ expectations, as it benefited from higher prices.