Updated

Cliff Pennington hit a go-ahead two-run double in the sixth inning, right-hander Trevor Cahill shook off an unusually rough start to record his team-leading 13th win and the Oakland Athletics beat the Tampa Bay Rays 4-3 on Thursday night.

Cahill, who allowed just one earned run in his previous 33 innings, gave up a pair of home runs and was in trouble until Pennington's two-out hit off reliever Dan Wheeler.

He got plenty of help from Oakland's defense, which turned two double plays. Center fielder Coco Crisp also made a leaping catch at the wall to rob Matt Joyce of a home run in the sixth.

Carlos Pena and Evan Longoria homered for the Rays, who snapped a five-game winning streak and fell one game behind the Yankees in the AL East.

It was the third straight win for Oakland after being held to one hit by Toronto's Shaun Marcum on Monday. The A's also made it back to .500 for the 21st time this season, two shy of the franchise most set in 1947 by the Philadelphia A's.

It wasn't easy.

Tampa Bay starter Andy Sonnanstine stymied Oakland's offense for five innings despite pitching with runners on base in every inning but one, while his teammates muscled up in a rare show of power against Cahill.

Oakland's right-hander had not allowed a home run since July 17 before giving up a two-run shot to Pena in the fourth and a solo shot to Longoria in the sixth.

Cahill (13-5) entered the game on a roll, carrying a 0.27 ERA over his last five starts. He settled down after Longoria's homer and retired seven of the final eight batters he faced.

Jerry Blevins pitched the ninth for his first career save.

Sonnanstine scattered five hits over 5 1-3 innings in just his third start of the season. The right-hander, who began the season in the Rays' bullpen, walked three and struck out three before leaving with two runners on and out in the sixth.

Wheeler (2-1) relieved Sonnanstine and walked Kevin Kouzmanoff to load the bases then gave up an RBI grounder to Rajai Davis that made it 3-2. Pennington followed with a line drive double down the right field line to give the A's the lead.

Tampa Bay had been cruising until then with a 3-1 lead.

Pena, who had missed 14 games on the disabled list until being activated Monday, went just 2 for 14 in the Rays' three-game sweep of Texas before collecting a pair of hits off Cahill, including his team-leading 24th homer.

Longoria's homer with one out in the sixth made it 3-1. Joyce nearly added to the Rays lead two batters later until Crisp jumped at the wall and caught the ball to rob Joyce of a home run.

Notes: A's closer Andrew Bailey will pitch one inning for Triple-A Sacramento on Friday, the latest step in his recovery from a rib cage strain. ... Tampa Bay's Carl Crawford had a nine-game hitting streak snapped. ... Pena, who broke into the majors with Oakland in 2002, has hit 13 career home runs at the Oakland Coliseum.