BALTIMORE - David Price gave up 10 hits, barely made it out of the fifth inning and was admittedly exhausted after walking off the mound for the last time.

Not a great combination for success, yet the reigning AL Cy Young winner still found a way to beat the Baltimore Orioles.

Evan Longoria and Matt Joyce homered, and Price grinded through the Baltimore batting order three times to help the Tampa Bay Rays earn a 4-3 victory Monday night in a duel between AL contenders.

Joyce hit a two-run drive in the fourth to break a tie and push the Rays toward their fifth win in six games. Tampa Bay remained a game behind the first-place Red Sox in the AL East after Boston defeated San Francisco.

Price (7-5) was effective when it counted. He struck out six and allowed only two runs, as Baltimore went 2 for 11 with runners in scoring position and stranded 10 against the left-hander.

"That's why he's one of the best pitchers in the game. He knows how to get out of jams like that," Orioles center fielder Adam Jones said. "When he needs a strikeout, he knows how to get it."

Price seemed relieved to survive.

"That's the most draining it has been in a while," he said. "This (Baltimore) team is just, they're tough. That's why they're in the position they're in right now. ... We made some pitches when we needed to, had some hard hit balls at some guys. You've got to have that good fortune sometimes."

Price has won four straight decisions since July 12.

"You have to give David credit," manager Joe Maddon said. "David did not have his best night, but nevertheless ... I really, really appreciated his effort."

So did Price's teammates.

"David didn't have his best stuff tonight, and he did a great job battling, really giving us a chance to win,""Joyce said.

Fernando Rodney, the fourth Tampa Bay reliever, worked the ninth for his 28th save.