Longoria homered in the first inning, giving him a home run in three consecutive games. He added a two-run homer in the eighth.
"I feel good," Longoria said. "I was talking to Carl [Crawford], and it's one of those things -- when you get on a roll like this, you just have to ride it as long as you can. Obviously, I don't always feel this good the whole year. [I] try to keep doing the same things I've been doing every day. Hopefully, it works out in the game."
A leading indicator that Longoria is indeed in the groove is when he hits the ball to center or right field. His first home run came off Orioles starter and former Rays left-hander Mark Hendrickson, and it cleared the wall in center field.
"That's obviously when I realize I'm right," Longoria said. "... When I'm able to stay back on a changeup and hit it the other way, something's going good. A couple of at-bats I kind of gave away in the middle. But, overall, I felt pretty good at the plate."
Hendrickson bit the hand that once fed him by surrendering just one run in 5 1/3 innings to pick up his first win of the season.
"He kept the ball down," Crawford said. "We hit some balls good, but right at people -- but he pitched a good game."
The Orioles trumped Longoria's first-inning homer in the bottom half of the inning, when Melvin Mora singled home two off Rays starter Andy Sonnanstine for a 2-1 lead.
Sonnanstine got some help in the field from right fielder Ben Zobrist, who extinguished an Orioles disturbance in the second, when he dove to backhand Cesar Izturis' sinking line drive and rose to his feet to throw a strike to shortstop Jason Bartlett, who stepped on second base to double off Gregg Zaun.
But the Orioles got back to business with two outs in the fifth, when they pushed three runs across the plate on RBI singles by Nick Markakis and Mora. Aubrey Huff scored another run on a Sonnanstine wild pitch to give Baltimore a 5-1 lead.
"I just didn't feel in sync with my body," said Sonnanstine of his first outing of the season.
Sonnanstine's remark felt appropriate for an evening in which the Rays played hard, but seemed just a little out of sync. Rays hitters struck out nine times and there were several pivotal plays that went against them.
For starters, Crawford got thrown out at third trying to stretch a double into a triple in the first inning. Longoria hit next and crushed his first homer of the night.
"They said the ball bounced right back to [Orioles right fielder Markakis]," Crawford said. "If I'd have seen that, I would have stopped [at second]."
On two different occasions Crawford dove for balls in left field, only to miss by inches. And there was an inning-ending mental gaffe by Gabe Kapler in the fourth, when Zobrist legged out an infield hit and Kapler found himself exposed after rounding third base too far. Huff alertly threw home from first base, and Kapler was tagged out in the ensuing rundown.
"A stupid baserunning play -- completely my responsibility," Kapler said. "This obviously should never happen, but I looked down and touched the base and assumed that [Zobrist] was out at first base. I was rounding the base in case the ball got past the first baseman. Bottom line, bad baserunning play; can't happen."
Dioner Navarro added a solo homer in the ninth off Orioles closer George Sherrill for the final margin. Appropriately enough, the final out came when Akinori Iwamura struck out against George Sherrill.
The loss snapped the Orioles' 12-game losing streak to the Rays.
Bill Chastain is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.