ST. PETERSBURG -- Work the process, work the process, work the process.

If there was one thing Tampa Bay Rays manager Joe Maddon said this week – and he said it often – was his team needed to work the process.

Have good at-bats.

Continue to put the ball in play.

“It will comeback to us,” Maddon said before Friday night’s game and before every game since his team fell into this offensive funk during the final game of their last homestand.

On Friday, it came back to them.

The Rays recorded season-highs for hits and runs and rallied from a four-run, second inning deficit to beat the New York Yankees 11-5 in front of a Tropicana Field crowd of 26,079.

James Loney drove in four runs with a two-run double and a two-run single to help snap the Rays season-high four-game losing streak.

His last hit capped the comeback and gave the Rays a 6-5 seventh inning lead. It was the fourth go-ahead RBI of the season. It was also the Rays first lead since Loney’s solo home run in the second inning last Saturday powered them to a 1-0 win at Cincinnati.

“It felt great, everybody having fun, scoring a lot of runs,” Loney said. “We’ve been hitting the ball pretty good lately, I thought. Just sometimes they catch them.”

Wil Myers snapped a 10-game RBI drought with three RBI. The first came on a single in the sixth inning that cut the Yankees lead to 4-3. The last two came on a ground ball that bounced off the third base bag during the Rays five-run eighth inning.

“This can definitely be a reset kind of game,” Maddon said.

The Rays 11 runs were the most since they scored 12 on July 1, 2013 in Houston. It was the most runs they scored at the Trop since Sept. 22, 2012 against Toronto.

All 11 runs came between the fourth and eighth inning. Before that, the Rays had managed only 10 runs in their previous 57 innings.

Remarkably, all 11 runs scored with two outs.

“We got a lot of good hitters here, a lot of guys who want to be up there in those situations, who want to have those opportunities,” Loney said. “It’s good to have.”

Erik Bedard, making his first start as a Ray, allowed four runs in the second inning. A bases-loaded double by Scott Sizemore did the most damage.

Bedard went 3 2/3 innings and was replaced by Brad Boxberger, who helped stop the Yankees bats and enabled the Rays to rally.

After the game, Boxberger was optioned back to Triple A Durham so the Rays can call up a fresh arm today for the bullpen.

The Rays, blasted 10-2 the previous night by the Yankees, chipped away.

Loney’s two-run double in the fourth inning off Yankee starter Hiroki Kuroda cut the Yankees lead in half.

Myers single in the sixth inning scored Matt Joyce and made it a one-run game.

The Yankees added a run in the top of the seventh off Jake McGee.

The Rays offense then erupted for three runs in the seventh to take the lead and five in the eight to ice the game.

“The approach has been great,” Maddon said. “Finally, we got a couple of balls to find some grass or between defenders. So that’s good. I’m really proud of the guys for not caving in to the moment. They continued to push all the way through it. Get down four-nothing and the other team’s got a lot of good stuff going on, the comeback the way we did is pretty impressive.”

Desmond Jennings, pinch-hitting for Joyce, singled in a run to make it a 5-4 game.

Loney followed a walk to Evan Longoria that loaded the bases with a line drive single to right-center field off Adam Warren.

“He left something out over the plate a little more than he wanted,” Loney said. “They were trying to come in. I just got it over the second baseman’s head.”

Sean Rodriguez hit a two-run homer in the eighth inning off Warren to make it an 8-5 game. It was his first home run off a right-handed pitcher July 3, 2012 when he homered off New York’s Ivan Nova. He also homered in the third straight home game he played in since the birth of his son, Zekiel.

Brandon Guyer added an RBI single before Myers put the game away with a two-run single off the third base bag.

“Feels really good,” Myers said about finally coming through in a big situation. “I don’t think I’ve had an RBI since the third game of the year. To get three was pretty big. I’m excited for (tonight).”

Actually, Myers’ last RBI came in the fifth game of the year. He snapped a 10-game RBI drought Friday.

Afterwards, the Rays celebrated the win with a long clubhouse post-victory dance party.