ST. PETERSBURG -- Two at-bats into Friday night's game, it seemed like the Yankees were ready to cruise to an easy win and bring their division rival's momentum to a screeching halt.

Derek Jeter led off with a single to center field, and Nick Swisher followed that up by slamming his 19th home run of the season to right field. Tampa Bay right-hander Wade Davis looked rattled, and it was hard to imagine the rookie would recover.

But after giving up three hits in the first inning, Davis dominated the next six. And the Rays took advantage of the lone mistake by Yankees starter Phil Hughes -- Matt Joyce's three-run homer in the sixth -- to escape the matchup between baseball's two best teams with a 3-2 win before a sellout crowd of 36,973 at Tropicana Field.

The Yankees' lead in the American League East dropped to one game, while Tampa Bay extended its winning streak to seven games.

"He made one mistake," manager Joe Girardi said of Hughes. "He just didn't get it where he wanted to, and you hope that the one mistake doesn't cost you. But it did tonight.

"It's unfortunate, because he pitched a great game, but these are the types of games that you play against these guys."

Hughes looked spectacular early on, entering the bottom of the sixth having given up no runs and just two hits. But Rays catcher John Jaso led off the inning with a single to center and stole second. Hughes then walked Evan Longoria, who was thrown out at second as Jaso advanced to third on a fielder's choice by Carlos Pena for the second out of the inning.

Just one strike away from getting out of the jam, Hughes left a fastball out over the plate to Joyce, who drilled the ball deep into the right-field stands. Swisher frantically tried to scramble up the fence to reel it in, not realizing how well the lefty-hitting Joyce had gotten under the 2-2 pitch.

"Everybody wants to be the hero. That game tonight for us was lost on one pitch," Swisher said. "Hughes threw an amazing game, no doubt, but just one pitch was the difference. You don't want to look at it in a negative way because of everything else he did, but it was just one pitch. That's it.

"After I watched the replay, that ball was like 10 rows deep. Unless I was having a Coke and a popcorn up there, I wasn't going to catch that. That was a huge hit for them, obviously. It won the game."

Hughes had been outstanding until that home run. He left the game after surrendering just four hits and two walks while striking out six. Girardi said it might have been the best Hughes has looked all year, and the right-hander said the outing was "a step in the right direction" -- an encouraging sign despite the way Hughes has cooled down since his 10-1 start to the season. Even Rays manager Joe Maddon offered up praise for Hughes, who took the loss and fell to 12-4 with a 4.07 ERA.

"Both sides pitched really well tonight. Hughes was really good. That's as good as I think I've seen him," Maddon said. "I just thought it was a well- played game on both sides. They hit a two-run homer, we hit a three-run homer -- we win."

While Hughes faltered late and Davis struggled early, the Rays rookie gave up only one hit in his final six innings of work -- a broken-bat single to right field by Robinson Cano. Davis won his fourth straight start, the longest winning streak of his career, and finished with six strikeouts, three of which came in the first inning after he gave up Swisher's shot.

"That must have really upset him or something," Swisher said. "You've got to give credit where credit is due. After that, he really seemed to find his groove."

Girardi said Davis simply located his pitches better after the homer. He was finding his spots with his fastball and effectively using his curveball, which kept the Yankees' lineup -- including Alex Rodriguez -- guessing. Rodriguez went 0-for-4 with a strikeout, remaining one shy of his 600th career home run. He has now gone eight games and 34 at-bats without a homer since hitting No. 599 on July 22 against Kansas City.

Rodriguez looked visibly frustrated, but Girardi said that had more to do with the overall importance of the series and less with the wait for the historic homer.

"We didn't get a lot of hits," Girardi said. "Sometimes you've got to look at the guy on the mound. We got four hits tonight, and three of them were in the first inning. His at-bats tonight, I was fine with them.

"I don't think it's with his at-bats. This is a game that you're trying to grind out. We understand that these aren't the-end-of-the-world games, but these are important games. We're trying to win our division, and we're trying to win this series."