The Red Sox overcame a one-run deficit with a four-run sixth, giving them their third win in four games.
Tim Wakefield (11-3) won his fifth straight decision, giving up one earned run while scattering 10 hits over six-plus innings. He struck out eighth.
Oakland starter Trevor Cahill (5-8) took a shutout into the sixth, but he allowed the first four batters in that inning to score.
J.D. Drew led off the sixth with a home run, after which Dustin Pedroia reached on an infield single and Kevin Youkilis walked. That brought up Ortiz, who homered to right on a 2-1 pitch, his 10th of the season.
Ortiz drove in another run in the seventh with a ground out.
With Boston holding a two-run lead, Jonathan Papelbon came on in the ninth to record his 22nd save. It turned out to be a shaky one.
Adam Kennedy walked to start the inning and went to third on a single by Orlando Cabrera. Scott Hairston's sacrifice fly delivered Kennedy to bring the Athletics within a run, after which Matt Holliday struck out.
Kurt Suzuki then singled, with Cabrera going to second, but Jack Cust struck out swinging to end the game.
Copyright 2009 by United Press International.