ST. PETERSBURG, Fla. (AP) — Timely hitting and another stellar job by the bullpen. After a rough June, the Tampa Bay Rays seem to be getting their act together again.

“I like the way we’re playing,” manager Joe Maddon said after Monday night’s 6-5 victory over Boston moved his team past the Red Sox into second place in the AL East.

The Rays improved to 4-1 in July after going 11-14 last month and losing the two-month grip they held on first place in the division.

Jason Bartlett’s sacrifice fly in the seventh inning snapped a tie and Tampa Bay rallied from a four-run deficit against right-hander Daisuke Matsuzaka to beat the Red Sox for the sixth time in 10 meetings this season.

John Jaso drove in two runs with a base-loaded single that made it 5-5 and chased Matsuzaka in the sixth. Bartlett’s sacrifice fly off Ramon Ramirez (0-2) drove in pinch-runner B.J. Upton after Matt Joyce and Sean Rodriguez singled to open the Tampa Bay seventh.

A lack of hitting in key situations undermined the team most of June, but hasn’t been a problem in coming from behind to win the past three games.

“It getting back to the way it looked at the beginning of the season,” said Maddon, who watched his team rally in the late innings for victories Saturday and Sunday to complete a confidence-boosting series win at Minnesota.

Randy Choate (2-2) struck out the only batter he faced — bailing the Rays out of a bases-loaded jam in the top of the seventh — to get the win.

Joaquin Benoit pitched a perfect eighth before Rafael Soriano got the final three outs for his 22nd save in 23 opportunities.

“That’s a fantastic job by the bullpen,” Maddon said. “And the offense chipped away.”

Eric Patterson, acquired last month to provide depth for an injury-depleted Red Sox roster, hit a pair of solo home runs off Tampa Bay starter Matt Garza. Kevin Youkilis, Adrian Beltre and Bill Hall drove in runs during a four-run third inning for Boston.

But the Rays bullpen held the Red Sox in check over the last five innings, giving an offense that’s come alive over the past week an opportunity to get back into the game against Matsuzaka, who allowed five runs and eight hits in five-plus innings.

They got away from the right-hander in the sixth when Rodrgiuez doubled off Matsuzaka, Carlos Pena walked and Bartlett layed down a bunt that left Boston in a bases-loaded jam when the pitcher wasted an opportunity to get an out at first.

Matsuzaka picked the ball and looked for a possible force play at third, even though Beltre — the third baseman — was standing beside him.

“Right off the bat it was my intention to make a play at third. I thought I did have a play at third. The catcher and third baseman were screaming at me, but their voices were lost in the crowd,” Matsuzaka said through an interpreter.

“The sixth inning was a tough inning. A lot of baserunners and through all that the bunt ends up being a huge play,” Boston manager Terry Francona said. “They’re trying to give you an out. Not getting that out ends up being huge.”

Jaso followed with his game-tying single.

The Red Sox squandered a chance to break a 5-5 tie after loading the bases with one out in the seventh on Patterson’s third hit and two walks. Balfour struck out Beltre, then Choate came on to fan J.D. Drew to end the threat.

Garza, who beat Matsuzaka and the Red Sox 9-5 at Fenway Park last week, allowed four runs and seven hits while throwing 84 pitches over three innings.

Six consecutive Red Sox reached base after the Rays starter retired the first two batters in the third, with Patterson starting a four-run uprising with his first homer since being acquired last month after All-Star Dustin Pedroia went on the 15-day disabled list with a broken left foot.

David Ortiz walked and scored a triple by Youkilis. RBI singles by Beltre and Hall put the Red Sox up 4-1.

Patterson homered again off Andy Sonnanstine with two outs in the fourth, giving Matsuzaka a four-run cushion that the right-hander couldn’t hold.

Evan Longoria’s fifth-inning sacrifice fly trimmed Tampa Bay’s deficit to 5-2. The Rays added another run in the inning when a passed ball, charged to Kevin Cash, permitted Carl Crawford to score from third base.

Crawford had three of Tampa Bay’s eight hits off Matsuzaka, including a RBI double in the first inning.

NOTES: Boston All-Star RHP Clay Buchholz (10-4, 2.45 ERA) was placed on the 15-day disabled list because of a strained left hamstring. Lefty Felix Doubront was recalled from Triple-A Pawtucket to start Tuesday night against the Rays. Buchholz could return to the rotation shortly after the All-Star break. … Tampa Bay’s B.J. Upton, who’s 1-for-13 lifetime against Matsuzaka, did not start. He entered the game as a pinch runner in the seventh, scored the go-ahead run and remained on defense in the eighth. … Boston RHP Josh Beckett, on the DL with a lower back strain, is scheduled to pitch in a rookie-level Gulf Coast League game Tuesday in nearby Sarasota. If the GLC game is postponed by rain, Beckett will throw a simulated game at Tropicana Field against Red Sox minor leaguers.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.