OAKLAND, Calif. -- Scott Kazmir threw seven strong innings, Yoenis Cespedes hit his 14th home run of the season, and the Oakland A's beat the Boston Red Sox 4-2 Thursday night in the opener of a four-game series at the O.co Coliseum.

Kazmir (9-2) won his fourth decision in a row, striking out eight, walking none and allowing just two runs on four hits.

The A's won their third straight game and moved a season-high 17 games over .500. At 45-28, Oakland owns the best record in the major leaves.

Boston (34-39) saw its three-game winning streak end.

Red Sox right-hander Jake Peavy (1-5) lost his fifth consecutive decision, allowing four runs, three earned, and five hits over 6 1/3 innings. He struck out four and walked three. Peavy hasn't won since April 25 at Toronto.

Boston second baseman Dustin Pedroia hit a two-run homer in the sixth inning off Kazmir as the Red Sox cut Oakland's lead to 3-2. The home run was Pedroia's fourth of the season and first since June 7 off Detroit Tigers right-hander Max Scherzer.

Oakland added a run in the seventh when catcher John Jason ripped an RBI single off reliever Chris Capuano, driving in pinch runner Eric Sogard from second.

In the ninth, Pedroia hit a one out double off reliever Dan Otero. With two outs, catcher A.J. Pierzynski lined a drive to deep center, but Coco Crisp caught it at the wall. Otero recorded the first save of his major league career.

The A's took a 1-0 lead in the second inning, scoring an unearned run off Peavy. Third baseman Josh Donaldson lined a leadoff single off the left field fence, a ball that came within a foot of going over. He moved to second when Peavy walked former Red Sox shortstop Jed Lowrie.

Catcher Derek Norris hit a hard ground ball to Peavy. Instead of throwing to second to start what looked to be a sure double play, Peavy threw to third for the force. Third baseman Xander Bogaerts made a running catch for the force but made an off-balance throw to first that landed short and wide right for an error.

Both runners advanced, and Lowrie scored on right fielder Stephen Vogt's groundout to second.

The A's increased their lead to 2-0 in the third when left fielder Cespedes crushed a Peavy fastball over the left-center-field fence with two outs for his 14th home run of the season.

The A's made it 3-0 in the fourth as Lowrie lined a one-out double to left-center and scored on Vogt's bloop single with two outs.

NOTES: LHP Brad Mills will make his first start for Oakland on Friday night against Boston. The A's acquired Mills on Tuesday from the Milwaukee Brewers in a minor league trade for cash. Mills replaces LHP Drew Pomeranz in the rotation. Pomeranz broke his right hand Monday punching a chair in frustration after a rough start, and he went on the disabled list Tuesday. A's RHP Jesse Chavez will start Saturday instead of Friday. ... LHP Felix Doubront will come off the disabled list Friday to start for Boston. He was out for a month with a strained left shoulder. Doubront will fill in for RHP Brandon Workman, who is serving a six-game suspension. ... Boston RHP Clay Buchholz (hyperextended left knee) threw six scoreless innings Thursday afternoon in his second rehab start for Triple-A Pawtucket. Red Sox manager John Farrell said Buchholz's next start likely will be in the major leagues. ... Red Sox DH David Ortiz was out of the starting lineup Thursday, but he will start Friday, Farrell said.