The Tampa Bay Rays finally had reason to smile after snapping out of a historically poor offensive stretch.

Lucas Duda hit a two-run homer, Wilson Ramos added a solo shot and the Rays beat the Toronto Blue Jays 6-4 on Tuesday night, halting a four-game skid.

``We needed that win,'' manager Kevin Cash said. ``Once we got some runs, there was a looseness going on. We're all aware of what we've gone through over the last 10 games.''

The Rays came in having scored 12 runs in their past 10. According to Elias, that is the lowest total for any AL team over a 10-game stretch since the designated hitter was introduced in 1973. The Rays suffered five shutout defeats in that span, and lead the majors with 10 scoreless losses.

``I think everybody felt that every at-bat before (Tuesday), when we weren't scoring runs, was kind of do or die,'' slugger Evan Longoria said. ``To be able to get some runs early in the game and get out to a lead definitely took some of the pressure off.''

Backed by Tampa Bay's biggest offensive outburst since Aug. 1, Blake Snell pitched six innings to win for the first time this season. Snell's last victory came Sept. 22, 2016, against the New York Yankees.

``I thought his stuff was really good,'' Cash said.

Snell (1-6) allowed one run and four hits, ending a 16-start winless stretch.

Steve Cishek and Tommy Hunter each worked inning before Alex Colome finished for his 35th save in 40 chances.

Blue Jays slugger Josh Donaldson homered for the third consecutive game, hitting a three-run shot in the fifth. Donaldson has gone deep nine times in 17 games. The blast gave him 500 career RBIs.

Duda homered off Marco Estrada in the third, erasing a 1-0 Blue Jays lead, and Ramos went deep in the fourth for his second homer in as many games.

Corey Dickerson's RBI single made it 4-1, and the Rays chased Estrada (5-8) after Adeiny Hechavarria and Daniel Robertson drew bases-loaded walks in the fifth.

``The hope is it gets us going,'' Cash said of the 13-hit attack. ``There's a lot of smiles, a lot of cheering going right now. That's important.''

Estrada snapped a 12-start winless streak by pitching seven shutout innings against the Yankees in his previous outing but struggled to control the Rays, allowing six runs and 10 hits in 4 1/3 innings.

Estrada is 0-4 with a 10.61 ERA in four starts against the Rays this season, and 1-8 with a 4.96 ERA in 14 career games against Tampa Bay.

``Just one of those teams that has my number,'' Estrada said. ``I haven't been able to figure them out.''

EXTRA, EXTRA!

Of Donaldson's past 22 hits, 13 have been for extra bases. Teammate Jose Bautista, who doubled in the fifth, has 15 extra base hits among his past 19.

CONNECTING WHEN IT COUNTS

All four of Duda's home runs with the Rays have come with his team trailing.

WELCOME TO THE SHOW

Blue Jays LHP Tim Mayza made his major league debut in the ninth, beginning his career by striking out Peter Bourjos.

LEAKS AND LAUGHS

Asked before the game about a report that Estrada had been claimed on waivers, Gibbons said ``There's a leak? I thought that only happened at the White House.''

TRAINER'S ROOM

Rays: OF Kevin Kiermaier (right hip) started in CF and played five innings in a rehab game at Class-A Charlotte. He went 0 for 3 with a strikeout.

Blue Jays: C Miguel Montero (right groin) went 0 for 3 in his first rehab game at Triple-A Buffalo. ... Toronto released OF Chris Coghlan.

UP NEXT

Rays: RHP Jake Faria (5-3, 3.19) allowed a season-worst five runs in six innings in his previous start, an Aug. 11 loss to Cleveland. Faria is winless in three outings.

Blue Jays: RHP Marcus Stroman (10-6, 3.00) allowed four unearned runs over eight innings against Pittsburgh last Friday, losing for the first time in six starts.