ST. PETERSBURG, Fla. (AP) -- Ramon Hernandez had a breakout game and also helped a teammate overcome a second consecutive rough outing.
"When you're having a tough time, you hit the ball hard, you kind of know if it's going to leave or not," said Hernandez, who went 2-for-4 to increase his batting average from .156 to .194. "I was going to make sure it wasn't hooking foul."
Hernandez, who also had a run-scoring triple, gave Baltimore a 3-2 lead on his two-out homer off Dan Wheeler (0-1). The Orioles stopped a three-game losing streak.
"Ramon found a way to get the big hit," Orioles manager Dave Trembley said. "As soon as Hernandez hit the home run, as far as I'm concerned the game is over because Sherrill ain't going to let them score."
Carlos Pena homered for the second straight day off Orioles reliever Jamie Walker, a solo shot in the eighth that tied it at 2. Pena has three homers and seven RBIs in the first two games of the three-game series.
"I'm [mad] at myself," Walker said. "Last night I got beat on a bad pitch. I felt tonight I made a decent pitch, but decent pitches don't leave the yard. Obviously he's seeing something off of me. He's hitting like Babe Ruth the last two nights."
Walker gave up just two homers to left-handed batters in 81 appearances last season.
"We won the game, that's what matters," Walker said. "I'm Ramon's biggest fan right now. We've just got to keep plugging away."
Pena has six homers this season. He hit 46 last year, but only four came in April.
"Well, the guy's the natural," Trembley said. "That's what he's swinging it like."
Evan Longoria, taken third overall in the 2006 amateur draft by Tampa Bay, went 1-for-3 with a walk in his major league debut. The third baseman pulled the Rays within 2-1 on his first career hit, a groundball run-scoring single to left in the sixth.
"Nice first game for him," Rays manager Joe Maddon said. "Good at-bats. Well done."
Longoria admitted he was nervous during his first at-bat, which resulted in a grounder to second.
"It's probably the first in a long time," Longoria said.
Hernandez had an RBI triple in the second that put the Orioles ahead 2-0. It was his sixth career triple, coming on his 3,545th at-bat. Baltimore scored a run in the first when Nick Markakis hit into a double play.
It was the second time Hernandez has homered and tripled in the same game. The other came on Sept. 27, 2005 when he played with San Diego.
Markakis stayed in the game after getting hit by a pitch on the left wrist in the eighth. He had an ice pack on the wrist postgame, but he plans to play Sunday. ... Rays ace Scott Kazmir (left elbow) played catch one day after a 46-pitch batting practice session. He is scheduled to throw two innings in an extended spring training game Tuesday. ... Tampa Bay RHP Matt Garza (right arm nerve irritation) resumed playing catch. ... Rays RHP Jeff Niemann, taken fourth overall in the 2004 amateur draft, will make his major league debut Sunday. ... To make room for Niemann on the roster, the Rays optioned RHP Jae Kuk Ryu to Triple-A Durham. ... Orioles RHP Matt Albers will start Monday's game against Toronto. RHP Jim Johnson will replace Albers as the long man out of the bullpen.