ST. PETERSBURG, Fla. -- Jeff Niemann didn't win his spot in Tampa Bay's rotation until the end of spring training. It's turning out that late decision was a good one.
"He's probably pitching his best professional baseball right now, including all of his minor league stuff," Tampa Bay manager Joe Maddon said. "He's just gaining confidence. He was in total command."
Niemann (8-4), the Rays' No. 5 starter, has two shutouts this season. The 6-foot-9 right-hander, who is 6-1 over his last 10 starts, allowed two hits in a 2-0 win over Kansas City on June 3.
"It's good, but it's only halfway through," Niemann said. "We have another three months left, so you can't get too happy or contented."
An official scoring change after the game gave Oakland's Ryan Sweeney a two-out single in the ninth inning instead of a fielder's choice, which added a hit to Niemann's original line.
"I knew when he was warming up in the 'pen his arm angle was pretty good," Rays catcher Dioner Navarro said. "He needs to get on top of that ball and that's the way he pitched. He was throwing the ball downhill and he was getting ahead."
Niemann struck out six and walked three.
"A tall guy like that with good stuff, they don't see it every day," Maddon said.
Oakland third baseman Adam Kennedy agreed.
"He's a big guy and his fastball gets on you fast," Kennedy said. "He kind of works wild in the zone. It's not really on the middle of the plate."
Pena hit his 24th homer of the season and Longoria added a solo shot for Tampa Bay, which has won nine in a row at home. The Rays are 19-8 overall since June 10.
Oakland right-hander Vin Mazzaro (2-5) allowed three runs and seven hits over five innings in losing his fifth straight decision. The Athletics (35-49) have lost 11 of 15 to drop a season-high 14 games under .500.
Struggling Oakland first baseman Jason Giambi, dropped to seventh in the lineup, struck out twice and went 0 for 3 with a walk. He is hitting .193.
The Rays took advantage of two Oakland defensive lapses to take a 1-0 lead in the first. One pitch after Giambi and Mazzaro failed to catch a foul ball, B.J. Upton doubled. Upton went to third when shortstop Orlando Cabrera was charged with an error for missing Mazzaro's pickoff attempt, and later scored on Carl Crawford's grounder.
"I couldn't see that ball up there," Oakland manager Bob Geren said about Upton's foul. "It's crazy. It's a white dome with stuff going all across."
Pena made it 2-0 with a solo home run in the fourth. It was his first homer since June 27.
Ben Zobrist walked with the bases loaded to put the Rays up 3-0 in the fifth. Tampa Bay took a 4-0 lead one inning later when Dioner Navarro was hit by pitch and later scored on a wild pitch by Santiago Casilla.
Longoria snapped an 18-game homerless stretch with his 17th this season, and Pat Burrell hit an RBI double in the seventh.
Tampa Bay principal owner Stuart Sternberg, on a conference call, said he doesn't anticipate cutting the Rays' payroll if the team stays in the playoff hunt this season. The Rays started Friday with the majors' fifth-lowest average home attendance at 22,699, which is considerably lower than the defending AL champions had projected. Friday's attendance was 20,358. ... Athletics LHP Dallas Braden is scheduled to return from the bereavement list and start Saturday's game. ... Oakland RHP Justin Duchscherer (right elbow) could be ready to pitch in a minor league game by late this month. ... Tampa Bay LHP Brian Shouse (left elbow) threw 32 pitches in a simulated game and will pitch in another one Monday.