BALTIMORE — The Boston Red Sox found another way to lose, this time on a broken-bat single and an inside-the-park homer, and their 6-3 defeat against the Baltimore Orioles tonight dropped them into a tie in the AL wild-card race.

Boston’s 17th loss in 22 games enabled Tampa Bay to finally pull even in the duel for the league’s final playoff spot. The Rays, who beat the New York Yankees 5-2, trailed by nine games after play on Sept. 3.

With the score 2-all in the sixth inning, Boston starter Josh Beckett (13-7) allowed four runs in an uprising that began with Vladimir Guerrero becoming the career hits leader among Dominican-born players.

Guerrero broke a tie with Julio Franco by bouncing a single up the middle, his 2,587th career hit. The 36-year-old Guerrero then stole second base, and after a two-out walk to Mark Reynolds, Chris Davis broke his bat hitting a soft liner to right that brought home the go-ahead run.

Robert Andino followed with a deep fly to center that Jacoby Ellsbury had in his glove before crashing into the wall. Andino sprinted around the bases and made it home as the relay throw bounced past catcher Jarrod Saltalamacchia.

Boston loaded the bases with one out in the eighth, but Pedro Strop struck out Saltalamacchia and retired Marco Scutaro on a grounder.

Although Dustin Pedroia hit an RBI single in a run in the ninth, the Red Sox stranded two runners and fell short in their bid to win a second straight game for the first time since Aug. 27. Boston is 6-19 in September, the second-worst record in the majors behind the Minnesota Twins. It’s also the Red Sox’s second-worst September with only a 4-18 mark in 1926 surpassing it according to STATS LLC.

Jed Lowrie homered for the Red Sox, whose September swoon includes four losses in five games against Baltimore.

Beckett allowed six runs and seven hits in six innings. He won four straight decisions before losing to the Orioles twice in six days.

Troy Patton (2-1) retired all five batters he faced after entering for starter Tommy Hunter, who gave up one earned run in five innings.

Boston placed runners on second and third with two outs in the first before Hunter issued an intentional walk to Adrian Gonzalez and retired Lowrie on a fly ball. The Red Sox bounced back with an unearned run in the second on a two-out throwing error by rookie left fielder Matt Angle.

Matt Wieters tied it in the bottom half with an opposite-field drive into the left-field seats. Wieters has 21 homers this year after totaling 20 in his first two big league seasons.

Lowrie led off the fourth with his sixth home run, the third against Baltimore. Boston then got runners on the corners with two outs before Nick Markakis made a sliding catch of Carl Crawford’s sinking liner to right.

The Orioles drew even at 2 in the fifth on an RBI single by Davis. But with the bases loaded and one out, Beckett retired J.J. Hardy on a popup and struck out Markakis.

NOTES: Boston C Jason Varitek was a late scratch. He took a ball off his left knee in Sunday’s second game against New York. He was replaced by Saltalamacchia, who left in the eighth when struck near the throat by a foul ball. …  Ellsbury’s second-inning double extended his hitting streak against Baltimore to 34 games, longest by a Red Sox player against another team in the history of the franchise. … Manager Terry Francona said he hasn’t decided who will start Wednesday’s game. It could be 15-game winner Jon Lester on three days’ rest. … Francona said 3B Kevin Youkilis (sports hernia) is not closer to being ready to play. “He’s really sore. We’re probably fighting an uphill battle,” Francona said. …