BOSTON  — Tyler Glasnow gave playoff-bound Tampa Bay a short but strong start in his second outing since Tommy John surgery last year, but the Boston Red Sox rallied against the bullpen for a 4-3 victory on Monday night, extending the Rays’ skid to four games.

Boston pushed Tampa Bay closer to the No. 6 playoff seed in the AL. The Rays entered the night trailing Seattle by 1 1/2 games for the fifth seed. Tampa Bay will either face AL East rival Toronto, which occupies the top wild-card spot, or AL Central champion Cleveland in the opening round.

Glasnow struck out seven and held the Red Sox to two hits in 3 2/3 innings.

Christian Arroyo hit a two-run double and Kiké Hernández added a tying RBI double during a three-run sixth inning for last-place Boston, which ended a three-game skid. Rafael Devers drove in the go-ahead run with a sacrifice fly in the seventh.

Kevin Herget (0-1) relieved Glasnow and pitched the rest of the game, allowing four runs on seven hits.

Tampa Bay threatened in the ninth against Matt Barnes. Wander Franco tripled to center with one out, but got caught in a rundown on a grounder by Harold Ramírez for the second out. Barnes got Manuel Margot to ground out for his seventh save.

Boston starter Rich Hill struck out six batters over six innings. The 42-year-old lefty allowed three runs — one earned — on three hits in his 26th start of the season.

John Screiber (4-4) worked a scoreless seventh.

Harold Ramírez reached in the fourth on a throwing error by Devers at third. Margot then made Boston pay with his fourth homer of the season, a two-run blast that cleared the Green Monster and put Tampa Bay up 3-0.

Franco homered in the first off Hill, whose first two hits allowed were homers.

Glasnow departed with two down in the fourth after Triston Casas struck out swinging but reached on a wild pitch.