BOSTON (AP) Hanley Ramirez homered three times and drove in a career-high six runs and the Boston Red Sox held on for a 11-7 victory over the San Francisco Giants on Wednesday night even though newly acquired starter Drew Pomeranz struggled to protect an eight-run lead.

Boston won for the eighth time in nine games and moved into first place in the AL East, a half-game ahead of the Baltimore Orioles.

Ramirez also reached base when he was hit by a pitch in the fourth, glowering at Giants reliever Albert Suarez before the umpire quickly warned both benches. With the crowd chanting Ramirez's name for his final at-bat in the eighth, he grounded out weakly to the pitcher.

More from FoxSports

Ramirez began the day with eight home runs this season before connecting for his first three-homer game. He hit two-run drives in the second, third and sixth inning. The major league record for home runs in a game is four. It's been done 16 times, most recently by Josh Hamilton for Texas in 2012.

Travis Shaw and Sandy Leon also homered for Boston, and Mookie Betts had three hits.

Matt Barnes (3-3) was awarded the victory as the first effective Red Sox pitcher, coming on with a one-run lead and the bases loaded in the sixth and pitching out of it.

Giants starter Matt Cain (1-6) gave up three homers and five runs in 2 1/3 innings.

CUBS 6, METS 2

CHICAGO (AP) - Anthony Rizzo homered twice off Bartolo Colon, Kyle Hendricks pitched 6 1/3 scoreless innings and Chicago beat New York to take two of three in the rematch of last year's NL Championship Series.

Rizzo pulled a slider to right for a solo homer in the third. Two innings later with a runner on, he sent a fastball into the right-field bleachers.

Rizzo also hit a two-run homer Monday in a victory as the Cubs rebounded from a four-game sweep in New York this month. Chicago has won five of its last seven overall.

Hendricks (9-6) gave up seven hits and hasn't allowed an earned run in his last three appearances. He lowered his ERA to 2.27, third best in the majors.

Colon (8-5) gave up six runs and eight hits in 4 1/3 innings. Wilmer Flores hit his fifth home run in eight games, a two-run drive off Travis Wood in the eighth.

CARDINALS 4, PADRES 2, 1ST GAME

CARDINALS 3, PADRES 2, 2ND GAME

ST. LOUIS (AP) - Jedd Gyorko homered for the fifth straight game off San Diego pitching, connecting twice and driving in all three RBIs in a 3-2 victory to give St. Louis a doubleheader sweep.

Gyorko, dealt by the Padres in the offseason for outfielder Jon Jay, is 13 for 21 (.619) against his old team with six homers and 10 RBIs. He has 11 homers and 27 RBIs on the year with 40 starts spread across the infield. He started at third base in both games of the doubleheader.

He has four consecutive three-hit games against San Diego and four career multi-homer games, with both long balls in Game 2 off Paul Clemens (1-1).

Carlos Martinez (9-6) was dominant after a shaky first inning and a nosebleed in the second, and the Cardinals took the opener 4-2. Gyorko, Matt Holliday and Yadier Molina homered off Colin Rea (5-4).

Ryan Schimpf homered in both games for San Diego.

Jaime Garcia (7-6) allowed a run in 5 2-3 innings in the second game, and Seung Hwan Oh earned his fourth save in five chances, and second of the day.

NATIONALS 8, DODGERS 1

WASHINGTON (AP) - Bryce Harper led an offensive outburst with a home run into the third deck in right field and Washington beat Los Angeles.

Harper's 20th home run of the season, a two-run blast, traveled an estimated 451 feet off Bud Norris in the first inning. The National League MVP later walked and scored on Wilson Ramos' RBI double.

Ben Revere, Jayson Werth and Anthony Rendon also hit home runs and Trea Turner had an RBI triple and stole home for Washington. Gio Gonzalez (6-8) had one of his best starts of the season, allowing one run on three hits and striking out six in six innings.

Norris (5-8) gave up six runs on seven hits in five-plus innings before giving way to the bullpen.

INDIANS 11, ROYALS 4

KANSAS CITY, Mo. (AP) - Tyler Naquin hit two of the Indians' five homers and had a career-high six RBIs, helping Cleveland rout Kansas City.

Carlos Carrasco (7-3) only allowed one hit in six shutout innings, a one-out double by Cheslor Cuthbert in the fourth walked two in the sixth for his only other baserunners.

Naquin had his first multi-homer game, while Mike Napoli went deep for the second straight day. Jason Kipnis and Carlos Santana also hit home runs.

The first four homers were off Ian Kennedy (6-8), whose bizarre line included eight strikeouts and only one walk. But it was the ninth straight game Kennedy has served up a homer, and he has allowed 26 of them this season, tied with teammate Chris Young for most in the majors.

BLUE JAYS 10, DIAMONDBACKS 4

PHOENIX (AP) - Josh Donaldson and Edwin Encarnacion each hit two-run homers and Toronto beat Arizona.

Donaldson's homer off Patrick Corbin (4-9) landed in the Chase Field swimming pool in the first inning. Encarnacion's soaring shot off Daniel Hudson, projected at 471 feet, landed far down the walkway beyond the left field seats in the eighth. It was Encarnacion's 26th home run of the season and ninth in his last eight games at Chase.

Marcus Stroman (8-4) allowed only an unearned run on eight hits in eight innings to help the Blue Jays sweep the two-game series. Tuffy Gosewisch hit a three-run homer in the ninth for Arizona.

TWINS 4, TIGERS 1

DETROIT (AP) - Max Kepler and Eddie Rosario homered off Francisco Rodriguez in the ninth and Minnesota Twins scored three runs in the inning to beat Detroit.

Detroit wasted a fine start by Justin Verlander, who gave up a run and two hits in eight innings. Rodriguez (1-1) retired the first two batters of the ninth before Kepler sent a drive to right field to break the 1-all tie. Rodriguez then made a throwing error and appeared to be shaken up, but after a conference at the mound he stayed in the game and allowed a two-run shot by Rosario.

Ryan Pressly (3-5) was the winner, and Brandon Kintzler pitched the ninth for his sixth save.

Minnesota's Joe Mauer and Detroit's Ian Kinsler homered in the first inning.

YANKEES 5, ORIOLES 0

NEW YORK (AP) - Michael Pineda pitched six innings, Mark Teixeira homered in his return from his latest injury, and New York beat Baltimore to move two games above .500 for the first time since April.

Pineda (4-9) had six strikeouts with runners in scoring position and didn't allow a run for the first time all season. New York has won the first three of the four-game series to improve to 38-36 - the last time the Yankees were two games over .500 was April 12 when they were 4-2.

A stomach bug has been ravaging Baltimore's clubhouse and claimed two more victims in third baseman Manny Machado and manager Buck Showalter. Bench coach John Russell filled in for Showalter. First baseman Chris Davis missed his third straight game with flu-like symptoms.

Yovani Gallardo (3-2) was the loser.

MARINERS 6, WHITE SOX 5, 11 INNINGS

SEATTLE (AP) - Leonys Martin hit his second home run of the game, a solo shot with one out in the 11th inning that sent Seattle past Chicago.

Martin hit a two-run drive in the second inning. He then drove an 0-2 pitch from Dan Jennings (3-2) over the wall in right for his 13th homer.

Vidal Nuno (1-1) pitched one inning for the victory. Seattle pulled to 5-4 on Mike Zunino's two-run homer in seventh, and tied it on Adam Lind's solo shot in the eighth.

Seattle ace Felix Hernandez, activated off the disabled list earlier in the day, allowed five runs on 10 hits in 6 2/3 innings. He struck out two and walked two in his first start since May 27.

Todd Frazier hit a three-run homer in the first off Hernandez. Frazier's 28th home run tied him for the major league lead with Baltimore's Mark Trumbo.

REDS 6, BRAVES 3

CINCINNATI (AP) - Tucker Barnhart and Joey Votto hit two-run homers, and Cincinnati rallied to beat Atlanta to win the season series between the NL's worst teams.

Barnhart's homer completed a four-run rally in the sixth off Lucas Harrell (1-2). Votto extended his post-All Star break surge with his 16th homer off Ian Krol in the seventh. Votto is 11 for 20 in the last six games with two homers, a double and six walks.

Anthony DeSclafani (5-0) kept up his streak of solid starts since returning from a strained oblique that sidelined him for most of the first half. The right-hander gave up eight hits, including Freddie Freeman's homer, in eight innings. DeSclafani is 5-0 in his last six starts with a 2.61 ERA.

Adonis Garcia led off the ninth with a homer off Ross Ohlendorf, the 68th homer allowed by Cincinnati's bullpen - by far the most in the majors.

PHILLIES 4, MARLINS 1

PHILADELPHIA (AP) - Jeremy Hellickson struck out eight in eight innings, Tyler Goeddel hit a two-run homer and Philadelphia beat Miami.

Hellickson (7-7) allowed one run and five hits, improving his value as the Aug. 1 trade deadline approaches. Miami's Wei-Yin Chen (5-4) gave up four runs and 11 hits in 5 1/3 innings.

Chris Johnson hit a solo homer in the fifth for the Marlins.

Goeddel snapped an 0-for-16 slump with an opposite-field shot to right to give the Phillies a 2-0 lead in the first. He lined an RBI single to right to make it 3-0 in the second.

Jeanmar Gomez finished for his 26th save in 29 tries.

ASTROS 7, ATHLETICS 0

OAKLAND, Calif. (AP) - Doug Fister pitched seven innings and Jose Altuve continued his torrid hitting to help Houston beat Oakland.

After losing three of his last four decisions, Fister (10-6) threw seven innings of four-hit ball and struck out five. The A's failed to advance a runner past second base against Fister.

Altuve was 2 for 3 with two walks. Baseball's leading hitter is 12 for his last 17 in his last four games. The Astros, who had lost three of their previous four, scored two runs in the second with two outs and nobody on base when five batters reached safely against A's starter Daniel Mengden (1-5).

ANGELS 7, RANGERS 4

ANAHEIM, Calif. (AP) - Jefry Marte hit a three-run homer and the Angels shut down a late rally by the AL West-leading Texas Rangers for a win that gave Los Angeles a three-game sweep.

It was the second straight sweep for the Angels, who won their sixth in a row and moved out of last place in the AL West.

Hector Santiago (8-4) pitched five innings for his third straight win.

Martin Perez (7-7) lost his third decision in as many games.

RAYS 11, ROCKIES 3

DENVER (AP) - Chris Archer struck out 11 over six innings for his first victory since June 6, Tim Beckham had a career-high five hits and Tampa Bay routed Colorado.

Evan Longoria kept up his hot hitting with two doubles to help the Rays take two of three to capture their first road series since June 6-8 at Arizona.

Archer (5-13) allowed two runs and four hits to halt a slide in which he had lost six of seven starts.

Jorge De La Rosa (6-7) lasted only four innings and gave up nine runs, seven of them earned.

BREWERS 9, PIRATES 5.

PITTSBURGH (AP) - Jonathan Lucroy had a two-run single in the sixth inning and finished with three RBIs in Milwaukee's victory over Pittsburgh.

Jonathan Villar, Hernan Perez and Ryan Braun had two hits each for Milwaukee and Chris Carter and Scooter Gennett drove in two runs apiece while the Brewers jumped on starter Jeff Locke (8-6).

Carlos Torres (2-1) won in relief of Chase Anderson, who struggled once again but was bailed out by an offense that took it to Locke (8-6).