ST. PETERSBURG, Fla. — Rick Porcello took a shutout into the eighth inning, Mookie Betts hit his 22nd home run and the Boston Red Sox beat the Tampa Bay Rays 3-1 on Saturday night.

The win reduced Boston’s magic number for clinching a playoff spot to six and kept its AL East lead over the New York Yankees at three games. It was the eighth win in 10 games for the Red Sox.

Porcello (10-17) gave up one unearned run in 71/3 innings, allowing five hits and a walk to win for the sixth time in nine starts.

Craig Kimbrel pitched the ninth for his 33rd save.

Adeiny Hechavarria led off Tampa Bay’s seventh with a double against Porcello, moved to third on a passed ball and scored when a throw from first baseman Mitch Moreland bounced off a runner on a double-play attempt.

Betts started the second inning with his homer off starter Alex Cobb and drove in another run with a sixth-inning single, his 12th RBI in eight games.

Rafael Devers drove in Betts with a two-out double off reliever Dan Jennings.

Cobb (11-10) gave up three runs and six hits in 51/3 innings.

Logan Morrison was ejected from the Rays’ dugout in the sixth inning.

LEFT-HANDER David Price, who last pitched on July 22 because of left elbow inflammation, could make an appearance out of the bullpen Sunday. He was activated Thursday, a day after a 48-pitch bullpen session.

WITH less than three weeks until the playoffs begin, the Red Sox $22 million designated hitter has started just twice in the last six days.

Hanley Ramirez was out Friday and Saturday nights against Tampa Bay. Manager John Farrell revealed Thursday that Ramirez’s cranky shoulders have “flared up again.” But Friday Farrell said Ramirez was suffering from a different ailment.

“Hanley’s sore, left biceps has flared up on him,” Farrell said. “He just came into the clubhouse here after getting an MRI, so we’re waiting on the results of the test done here today.”