PHOENIX (AP) Desmond Jennings helped the Tampa Bay lineup keep right on rolling Monday night.
The slumping Jennings had three hits, including a home run, and Tim Beckham also went deep to power the Rays past the Arizona Diamondbacks 6-4.
''It was all about the offense tonight,'' manager Kevin Cash said. ''Desmond Jennings broke out, and that was good to see. A lot of guys who have been grinding through it and they got off tonight.''
Tampa Bay has won four straight and scored six runs or more in its past three games.
Almost lost in all the offense was a solid outing from starter Chris Archer (4-7), who struck out 12 over six innings. Archer allowed three runs, five hits and three walks in his first win since May 17.
''I really would have liked to go deeper but I had to do what I had to do,'' Archer said. ''When you strike a lot of people out, your pitch count is going to be high.''
Alex Colome, appearing for the fourth straight game, worked the ninth for his 16th save in as many chances.
''(The coaches) said maybe you're down but be ready for it,'' Colome said. ''You never know. If they need me to pitch, I can pitch.''
Archer credited Colome for asking to pitch.
''He called down and said, `I want the ball,''' Archer said. ''I admire that. What Colome has been able to endure and accomplish is fantastic.''
David Peralta homered in his first game off the disabled list for the Diamondbacks, who have lost 17 of 25. Arizona is 9-21 at home, the second-worst record in the majors behind Atlanta.
Beckham hit a two-run homer and Jennings added an RBI double during a four-run fifth against Robbie Ray (2-5).
Ray gave up five runs and eight hits in 4 2/3 innings with three walks and six strikeouts. He also opened the scoring in the third with his first career home run.
''I think I just try to do too much,'' Ray said. ''Those first four innings I keep telling myself, `Nice and easy and get groundballs and get guys out.' The fifth inning started snowballing a little bit and I tried to do too much.''
Arizona tacked on a run in the third on an RBI double by Paul Goldschmidt to take a 2-0 lead.
Tampa Bay pulled to 2-1 on Curt Casali's RBI single in the fourth before chasing Ray in the fifth.
Mikie Mahtook led off with a double to right field and Beckham followed with his third homer of the season for a 3-2 Rays lead. Ray walked Evan Longoria and Logan Morrison, struck out Steven Souza Jr., and then gave up Jennings' double that went over the right-field fence on one hop to make it 4-2.
Morrison scored on Taylor Motter's sacrifice fly.
It marked the fourth time in 12 starts that Ray failed to get through the fifth inning.
''I really don't think it is a mental thing,'' Arizona manager Chip Hale said. ''But I know that (pitching coach) Mike (Butcher) went to talk to him after and basically laid down the line, saying, `You are going to have to find a way to get through the fifth inning. You are better than that.'''
Peralta cut the deficit to 5-3 with his home run to right-center in the sixth, but Jennings homered high off the left-field foul pole in the seventh to give the Rays a 6-3 advantage.
The Diamondbacks got a run in the seventh on a two-out, bases-loaded walk by Enny Romero to Welington Castillo. Xavier Cedeno came on to strike out pinch-hitter Brandon Drury and end the threat.
Before the game, the Diamondbacks activated Peralta from the 15-day disabled list and optioned RHP Silvino Bracho to Triple-A Reno. Peralta had been sidelined since May 15 with inflammation in his right wrist. In 33 games prior to the injury, he was hitting .260 with seven doubles, three triples, three homers and 12 RBIs.
Ray's home run leading off the third was his third hit of the season. He became the first Arizona pitcher to homer since Wade Miley on April 22, 2013, at San Francisco. It was the first home run by a Diamondbacks pitcher at Chase Field since Daniel Hudson connected on July 17, 2011, against the Los Angeles Dodgers.
STILL A GOOD NIGHT
Longoria had his streak of four straight games with a home run snapped, but he finished 1 for 2 with two walks and a run scored.
ARCHER ON TARGET
Archer's 12 strikeouts were one more than he had in his past two starts combined and they matched his season high set in Tampa Bay's 5-3 loss to Toronto on opening day. Archer threw 73 of 115 pitches for strikes. He has walked three or more batters in eight of his 13 starts.
COLOME CLOSING PERFECTLY
Colome tied the club record for most consecutive saves to start a season. He has yet to allow a run in his 16 save chances spanning 16 2/3 innings. ''Maybe I'll fly him out so I'm not able to go to him tomorrow,'' Cash said.
Matt Moore (2-3) starts Tuesday night for Tampa Bay against Zack Greinke (7-3).