Updated

After losing a weekend series to their despised rivals, the Boston Red Sox will try not to lose any more ground in the AL East when they open a three-game series Monday against the San Francisco Giants.

The Red Sox lost two of three to the New York Yankees and suffered a 9-6 loss in the rubber match Sunday night. Ryan Dempster was hammered in the start and allowed seven runs and nine hits in 5 1/3 innings. He also beaned Yankees third baseman Alex Rodriguez on a 3-0 count, leading to the emptying of both bullpens and Yankees manager Joe Girardi getting ejected.

"I was just trying to pitch him inside," Dempster said.

Girardi didn't see it that way.

"Everyone knows it was intentional and I don't understand why (Dempster) is left in the game," Girardi said. "(Home-plate umpire) Brian (O'Nora) and I have a long history together and I respect him but that was wrong."

Will Middlebrooks homered and was one of six players with an RBI. Shane Victorino had two hits and two runs scored, while David Ortiz and Jarrod Saltalamacchia added two hits and an RBI for the Red Sox, losers in seven of the last 10 games.

Boston's lead in the AL East is now down to one game ahead of Tampa Bay.

The Red Sox, who will also visit Los Angeles on their West Coast trip, hope Jon Lester can right the ship when he takes the mound Monday. Lester is 2-3 in his last five decisions and did not factor in the outcome of a 4-3 loss at Toronto last Wednesday, as he gave up three runs -- two earned -- in 6 1/3 innings.

Lester is 10-7 in 25 starts with a 4.31 ERA and won his only career start against San Francisco on June 27, 2010. The left-hander went the distance in a 5-1 win by the bay and allowed only a run and five hits with nine K's and one walk.

The Giants had a three-game winning streak stopped short with Sunday's 6-5 loss to the lowly Miami Marlins and went 3-3 on their East Coast swing.

Madison Bumgarner made the start for the defending World Series champions and avoided a decision after he was reached for four runs in five innings. The left-hander had control issues and walked four batters.

"It seemed like almost every pitch I threw was a hair off in the wrong direction," Bumgarner said. "I was just struggling making pitches today."

Sandy Rosario was dealt the loss for giving up Jeff Mathis' go-ahead RBI double in the bottom of the eighth inning. Hunter Pence hit a two-run homer in the first inning and Brandon Crawford led off the seventh with a solo blast in a losing effort.

San Francisco is back at AT&T Park for seven straight games versus Boston and Pittsburgh and will send Tim Lincecum to the mound Monday. The two-time NL Cy Young Award winner has struggled this season to a 6-12 mark in 24 starts to go along with a 4.38 ERA and is only 2-7 in his past nine decisions.

Lincecum didn't have his best stuff in last Wednesday's 6-5 loss at Washington and permitted six runs and seven hits in six innings. He tossed eight shutout innings and struck out eight in his previous outing on Aug. 8 versus Milwaukee.

The right-hander opposed Lester and the Red Sox back in 2010 and was dealt the loss for surrendering four runs in three innings.

Boston took two of three from the Giants in that series a few years ago and has won five of the last six matchups between the clubs.