ST. PETERSBURG, Fla. — The Tampa Bay Rays are on quite a run.

Kevin Kiermaier tripled to key a two-run sixth inning, Tommy Pham homered and the Rays won their seventh straight game by beating the major league-leading Boston Red Sox 5-1 on Saturday night.

“We’ve gotten some confidence, and I think we’ve found our identity,” Tampa Bay manager Kevin Cash said.

The surprising Rays will try to become the first team this season to sweep Boston in a series Sunday when the teams complete a three-game set.

“We’ve been good on getaway days and day games,” Red Sox manager Alex Cora said. “It would be a good day to put everything together, finish strong and turn the page in this stadium.”

Tampa Bay is a season-high eight games over .500 (69-61). The Rays have allowed three or fewer runs in seven consecutive games.

J.D. Martinez had two doubles in four at-bats for the Red Sox, who have lost five of seven. Boston (90-41) had its AL East lead sliced to seven games over the New York Yankees, who swept a doubleheader at Baltimore.

“At the end of the day I felt like we lost this game because we didn’t take it to them and they took it to us,” Red Sox starter Rick Porcello said. “That’s not usually the case for our ballclub.”

Martinez (.337) jumped ahead of teammate Mookie Betts (.335) for the best batting average in the majors. Martinez also leads in RBIs (110) and is second in the AL in homers (38).

Betts was hitless in four at-bats and is 6 for 38 (.158) over his last nine games.

Tampa Bay chased Porcello (15-7) in the sixth after Kiermaier tripled and Willy Adames was hit by a pitch. Kiermaier scored on a wild pitch by Ryan Brasier before Joey Wendle made it 3-1 later in the inning on a sacrifice fly.

“That was a huge hit, maybe the biggest one of the night,” Cash said about Kiermaier’s triple.

Pham hit a solo shot off Brandon Workman in the seventh, and Ji-Man Choi’s RBI triple put Tampa Bay up 5-1 in the eighth.

Pham returned after missing three games with a dislocated right ring finger.

“I didn’t think I had enough power to hit a home run,” Pham said. “My grip strength isn’t quite there, but I had enough.”

Porcello gave up three runs and six hits over five-plus innings.

Rays starter Ryan Yarbrough allowed one run and five hits in five-plus innings. Ryne Stanek (2-3) replaced Yarbrough and worked a scoreless inning for the win.

Tampa Bay threatened in four of the first five innings but went 2 for 11 with runners in scoring positions during that stretch. Brandon Lowe had an RBI single in the fourth that tied it 1-all.

Boston scored in the second on Mitch Moreland’s double-play grounder.

YANKEES SWEEP ORIOLES: Sonny Gray made the most of a foray into the starting rotation by taking a three-hitter into the seventh inning, and New York swept a day-night doubleheader at Baltimore, 10-3 and 5-1.

Gray (10-8) gave up three hits and a walk and struck out seven in 6 1/3 innings. The right-hander had been exiled to the bullpen after yielding seven runs in a loss to Baltimore on Aug. 1.

Pressed into service as a starter because a June 3 rainout created this split doubleheader, Gray allowed only one runner past second base in helping the Yankees notch their seventh win in eight games.

Austin Romine homered, had three hits and scored three runs for the Yankees.

Miguel Andujar homered and had four RBI in the opener, and J.A. Happ won his fifth straight start.

NATIONAL LEAGUE

CUBS 10, REDS 6: Daniel Murphy and Kyle Schwarber each hit a two-run homer, Javier Baez added a solo shot and Chicago beat visiting Cincinnati for its fourth straight win.

Murphy homered for a second straight day and is batting .407 (48 for 118) with nine homers in 31 career regular-season games at Wrigley Field – all but three of them before he joined the Cubs in a trade this week.

METS 3, NATIONALS 0: Washington was shut out for the third game in a row, something that had never happened since the team moved from Montreal, as Zack Wheeler pitched seven innings for his seventh straight victory, in New York.

Amed Rosario and Todd Frazier hit solo home runs to back Wheeler.

INTERLEAGUE

GIANTS 5, RANGERS 3: Andrew Suarez pitched seven scoreless innings of three-hit ball as San Francisco won at home.

The Giants announced earlier in the day that catcher Buster Posey will undergo hip surgery Monday in Colorado, ending what has been a painful and frustrating year for the six-time All-Star.

BLUE JAYS 8, PHILLIES 6: Aledmys Diaz hit a go-ahead three-run double in the eighth inning and Toronto rallied for a win at home.