BALTIMORE -- The Baltimore Orioles celebrated the return of Manny Machado to their lineup Friday with the kind of comeback victory that's becoming a bit of a trademark for them this season.

Chris Davis hit a go-ahead, two-run single and Adam Jones and Machado homered as Baltimore stretched the Tampa Bay Rays' losing streak to eight with a 6-3 victory Friday night.

Machado missed the last four games while serving a suspension for his role in a brawl with Kansas City earlier this month. He returned in style, going 2-for-4 with one RBI, two runs scored and gave Baltimore (42-30) a boost.

"It feels good to be back out there," Machado said. "It feels good to be back on the field and part of something. It's a special thing we have here going on. I was just excited to be back around my teammates and get a win today."

Yovani Gallardo gave up three runs after just four batters but recovered to not permit any more runs and went 5 1/3 innings in his second start since returning from the disabled list.

The first inning could have been worse but Gallardo worked out a big jam as the first five Rays reached base. However, the right-hander kept the Orioles close.

"It's just a matter of you give up two in the first inning, don't give up that third one," Gallardo said. "You give up three, don't give up that fourth one. Just try to manage the innings as best you can. The guys are going to hit."

And they hit plenty after Rays starter Matt Moore (3-5) retired the first 13 Baltimore batters. The key was a four-run sixth with the homer from Jones plus the big Davis hit.

Tampa Bay manager Kevin Cash said getting more out of that first inning probably would have helped.

"You just get the sense in this ballpark with the type of offense that we're facing that you've got to add on," Cash said. "Three probably just isn't enough, it doesn't matter who's on the mound."

The Orioles scored once in the fifth and turned the game around with the four-run sixth.

Jones started the rally with his one-out solo homer off Moore that cut the Rays' lead to 3-2. That seemed to give the Orioles a spark and woke up the fans at Camden Yards.

"It was just a bad pitch to Jones, which was me being hard-headed more so than anything," Moore said. "There are a lot of different pitches I can throw to AJ there. I don't have to challenge him. It was poor location."

With the bases loaded, Davis lined a single to right that scored Jonathan Schoop and Machado. Mark Trumbo came home on second baseman Logan Forsythe's throwing error on the relay.

Rookie Ashur Tolliver (1-0) got the final two outs in the sixth inning and picked up his first major league victory thanks to the four-run rally. Odrisamer Despaigne then blanked the Rays and Brad Brach did the same in the eighth.

"I definitely knew I was in line for the win," Tolliver said. "That was cool. It was just a great team win, all around. It was awesome."

Zach Britton closed it in the ninth for his 22nd save in 22 chances.

Corey Dickerson homered for Tampa Bay (31-40), a two-run shot off Gallardo in the first, but the Rays managed just five hits after that inning.

The Rays struggled on offense during their recent slide but started quickly. Forsythe started with a double and scored when Dickerson followed with his two-run homer. Evan Longoria doubled and scored on Logan Morrison's single to right for a 3-0 lead after just four batters.

Center fielder Desmond Jennings robbed Machado of a homer in the first with a leaping catch at the fence and left fielder Taylor Motter did the same to Jones in the fourth.

Baltimore broke through in the fifth when Davis doubled to left and scored on J.J. Hardy's single to right, drawing the Orioles within 3-1. The comeback had started but manager Buck Showalter said Moore did not hand them anything.

"If a guy's pitching well, I don't care you've done yesterday or the day before," Showatler said. "The possibility is there because you've done it before, but it depends on how many mistakes a pitcher makes and he didn't make many tonight."

NOTES: Orioles LHP Brian Duensing's surgery Friday to remove bone chips from his pitching elbow went fine, manager Buck Showalter said. Duensing goes to Sarasota, Fla., in the next day or two to begin rehab work, Showalter said. ... C Caleb Joseph (testicular injury and surgery) will catch in a game for the first time since the operation with Class A Frederick on Monday. He has been hitting in rehab games and catching in the bullpen, and if all goes well, it's possible he could join the Orioles in San Diego next week. Showalter said they'll evaluate the situation after Joseph catches Monday. ... LHP T.J. McFarland will be Baltimore's 26th man Saturday. ...The Rays acquired OF Oswaldo Arcia from the Minnesota Twins for a player to be named or cash. He'll join the team Saturday. ... In addition, Tampa Bay RHP Andrew Bellatti was designated for assignment to clear a spot on the 40-man roster. RHP Steve Geltz was sent back to Triple-A after the game, and RHP Danny Farquhar will be the 26th man in the doubleheader.