NEW YORK — The Rays have overcome a lot to get themselves playing better and feeling better about their chances.
And Monday they overcame a blown ninth-inning lead and a slew of wasted opportunities to record another inspiring victory, beating the Yankees 4-3 in 12 innings.
The win was the Rays' fifth in their past six games and 12th in 19 and, as they improved to 36-49, allowed them to shed the label of the majors' worst record they had worn since June 4.
"It was a great game then a strange game and then it becomes wonderful because you win,'' manager Joe Maddon said. "I've talked about winning games like this in extra innings on the road and what it means about a team, and to be constantly dejected a bit based on what happened and to still hang in there.
After Joel Peralta gave up a tying homer to Brian Roberts with one out in the ninth, and after getting nothing after loading the bases with one out in the 11th, the Rays reclaimed the lead in the 12th.
Brandon Guyer drew a two-out walk off Jose Ramirez, stole second and scored on a single by Logan Forsythe, who has shaken his seasonlong slumber to emerge as their hottest hitter the past two weeks, going 16-for-35.
"It was nice to be that guy tonight,'' Forsythe said.
Brad Boxberger pitched the final two innings impressively for the victory, retiring six straight. "He was in total command of the moment,'' Maddon said. "He totally did what we he wanted to out there.''
The Rays also earned a piece of history.
Their pitchers combined to strike out nine to give them 287 for June, breaking the major-league record for any month of 286 by the Kerry Wood/Mark Prior Cubs in August 2002. Boxberger got Ichiro Suzuki swinging in the 12th for the record. On the way Monday, they surpassed the American League record of 280 set by the Indians and Tigers in May 2013.
"Just to be able to get it, it's pretty fun to say I was a part of it,'' Boxberger said.
Chris Archer worked seven solid innings, allowing two runs on five hits, and was in line for an interesting notation of his own. Had he gotten the win, he would have been the first pitcher to beat the Yankees in his first five games against them since Hall of Famer Walter "Big Train" Johnson in 1907-08.
The Rays took an early lead on homers by Matt Joyce, his third in two days, and Kevin Kiermaier, who went deep for the third straight game. But then the Yankees tied it in the third, their rally starting when Archer hit Ichiro Suzuki with a two-strike pitch, then including a ground ball triple into the rightfield corner and an RBI groundout. "Those are the moments as a young pitcher you just can't permit to happen,'' Maddon said of the hit by pitch. "You're not even trying to throw the ball anywhere near there. That's a perfect example of room to grow for him.''
The game stayed tied until the Rays went ahead in the eighth, as Guyer and Forsythe drew back-to-back two-out walks off Dellin Betances and catcher Ryan Hanigan delivered greeted David Robertson with a run-scoring single.
They managed to hang on to the lead in the eighth, Jake McGee getting Carlos Beltran to pop out after two Yankees got on, the second when leftfielder Guyer misplayed a fly ball, taking an indirect route and then missing on a dive..
But they couldn't do so in the ninth. Peralta got the first out but mislocated a fastball too low and gave up a well-struck homer to Roberts on the eighth pitch of the at-bat. "Execution,'' Maddon said. It was the second homer Peralta gave up in four days and seventh on the season.
"To lose a game like this would have been really hard to walk in here, very difficult,'' Maddon said. "And then you don't know the negative complementary impact it's going to have."
Peralta was pitching in the ninth due to manager Joe Maddon's commitment to a bullpen by committee, which he went to after removing Grant Balfour from the closer's role in early June. His plan is to deploy is relievers over the late innings by who matched up better with the opposing hitters.
So that's why McGee, who has by far been the Rays' most effective reliever, was summoned for the eighth, to navigate what turned out — due to a pair of singles — to be the Yankees' Nos. 2-6 hitters. And that's why Maddon slotted Peralta for the ninth, where he would face the bottom of the New York order.
The Rays left 13 on while going 2-for-7 with runners in scoring position, failing three times with the bases loaded to drop to 10-for-59 on the season, though they made several key defensive plays, especially first baseman James Loney.
While Maddon said, obviously, it would have been better for Peralta to close it out in the ninth, the night didn't work out too badly after all.
"My personal theory is that to win on the road in extra innings really is good for a team's morale and really builds,'' he said. "We were fortunate to win the game, I appreciate the way the guys fought it.''