Updated

James Shields' first pitch put Tampa Bay into the record books. The rest of his night was as forgettable as it gets.

The Rays right-hander suffered his most lopsided loss of the season and became the third straight Tampa Bay starter to get knocked around by the suddenly resurgent Oakland Athletics, who had a season-high 17 hits on the way to a 13-4 win Wednesday night.

"It was an all-around terrible job," Shields said. "The ball was up and they were hitting it. I wasn't sharp all night right from the gates. I did a terrible job."

Tampa Bay struggled all game, on the mound and at the plate.

The night would have been a total loss had it not been for Shields making his record-breaking start.

It marked the 705th consecutive game the Rays have started a pitcher younger than 30 years old, breaking the previous mark held by the Washington Senators.

Shields, the All-Star right-hander who pitched the first game of the Rays' record-breaking streak when it began on May 25, 2007, allowed 12 hits and 10 earned runs — the third time in his career he has given up 10 runs in a game.

"It's not any fun," Tampa Bay manager Joe Maddon said. "Over the past two nights the ball has been up a little bit and (the A's) have been getting real good swings. To their credit, they are swinging the bats really well right now."

The Rays, who were only five games out of first in the AL East two weeks ago, lost for the 11th time in 15 games and dropped a season-high 11½ games behind first-place Boston in the AL East.

Hideki Matsui and Ryan Sweeney both homered as part of a nine-run fourth inning as Oakland improved to 8-4 since the All-Star break.

Matsui was 3 for 5 with five RBIs, Jemile Weeks had three hits, three RBIs and three runs scored, and Scott Sizemore added two hits and two RBIs to lead the A's.

"I think we've always had good hitters," Sweeney said. "Right now everybody's hitting so everybody's feeding off each other. Hopefully we can still come back and be in this thing somehow."

Trevor Cahill went 7 1-3 innings with six strikeouts for his first win in more than a month, benefiting from Oakland's best offensive output of the season.

Every Oakland starter had at least one hit while seven scored.

Sweeney had three hits and scored twice — both times in the fourth when Oakland broke the game open.

Conor Jackson also scored twice in the inning when the A's, who lead the majors in batting since the All-Star break, sent 12 men to the plate in the inning to chase Shields (9-9).

Matsui, who went 5 for 5 in a 7-5 loss to the Yankees on Sunday, hit an RBI double in the third, homered in the fourth and had a run-scoring single in the fifth.

Matsui's ninth homer of the season highlighted the A's highest-scoring inning of the season. The five RBIs are the most by Matsui since he had five against Baltimore on Sept. 13, 2009.

Sweeney had two hits in the fourth, including his first home run since May 4, 2010 that gave the A's a 10-0 lead.

Cahill (9-9) gave up four hits and walked four but stayed out of trouble all game. The right-hander, 0-4 in his previous five starts, only allowed one runner past second while earning his first win since beating Philadelphia on June 25.

Oakland, which has won seven of its last eight games at home, beat the Rays' top three pitchers — rookie Jeremy Hellickson, David Price and Shields.

The A's made it 13-0 on Weeks' bases-loaded sacrifice fly in the sixth but missed a chance for more when Cliff Pennington was doubled off second base on the play. It was the only mistake Oakland made.

Tampa Bay, which has been outscored 26-10 through the first three games of this four-game series, scored four times in the ninth to avoid its 11th shutout of the season.

Matt Joyce hit his 15th home run, while Desmond Jennings and Johnny Damon also drove in runs.

The Rays played without outfielder B.J. Upton, who has been the subject of trade rumors. Maddon said the decision to sit Upton had more to do with his 3-for-38 slump than the trade talk.

"I've just been looking for moments to give B.J. a rest," Maddon said before the game. "I know all these different things that are being swirled about has got to have some kind of an impact on him, too. I wouldn't think it would be easy to read that stuff all the time."

Notes: The Rays last started a pitcher 30 or older on May 24, 2007, when Jae Sao took the mound on his 30th birthday. ... Tampa Bay optioned RHP Jay Buente back to Triple-A Durham, one day after the reliever was called up and made his Rays debut. The team called up RHP Rob Delaney from Durham to take Buente's spot on the roster. Delaney pitched three innings but was told after the game he was being sent back down.