James Shields allowed one run in 6 1-3 innings Sunday to win for the first time in his past five starts, and the Tampa Bay Rays completed a three-game sweep by beating the Miami Marlins 4-2 Sunday.

The Rays outscored their intrastate rivals 22-7 and have won seven in a row against the Marlins. Miami fell to 0-6 on its homestand and has been outscored 43-10.

Matt Joyce hit his 11th homer and Elliot Johnson hit his third to help the Rays (35-25) improve the best record in the American League. Shields (7-4), who had lost his past three decisions, allowed four hits and struck out five.

Three relievers completed a seven-hitter. Fernando Rodney earned his 18th save in 19 chances with a scoreless ninth and lowered his ERA to 0.94.

Anibal Sanchez (3-5), plagued again by lousy run support, pitched six innings and allowed four runs, including both homers. He has made 12 starts this season, and the Marlins have scored 18 runs with him in the game.

Sanchez lost for the fifth time in his past six outings.

B.J. Upton and Ben Zobrist each had two of the Rays' eight hits. They've won four games in a row, totaling at least 10 hits in every game.

Gaby Sanchez, recalled before the game after a three-week demotion to Triple-A, doubled in the seventh to drive in the Marlins' first run. Teammate Logan Morrison, back in the lineup after being benched for two games because of a slump, had three hits and drove in a run.

But the Marlins went 2 for 11 with runners in scoring position. They're 5 for 50 in those situations during the homestand.

Jose Reyes, Omar Infante and Hanley Ramirez went a combined 0 for 12 at the top of the Miami order. Brett Hayes stranded four runners and is 1 for 15 with runners in scoring position this season.

Morrison doubled with one out in the second inning. Shields put out that threat and retired 10 in a row until pinch hitter Justin Ruggiano doubled to start the sixth.

Shields pitched out of that jam, too, striking out Giancarlo Stanton to end the inning.

Upton doubled off the scoreboard to drive in a run for Tampa Bay in the first inning.

Joyce led off the fourth inning with a homer into the first row of the center-field seats. Zobrist singled, and with one out Johnson homered for a 4-0 lead.

NOTES: RF Stanton slid headfirst on the warning track after he made a leaping catch to rob Zobrist of a hit. ... The Rays began the day with the best record in the AL at 34-25 (.576). That's the lowest winning percentage by the league leader on June 10 since 1959. ... Josh Beckett, the Marlins' World Series star in 2003, pitches against them for the first time Monday when Miami opens a series against the Boston Red Sox at home. ... The crowd of 31,111 included 648 tickets for dogs on bark at the park day.