Smoak hit his 33rd homer of the season with one out against Tommy Hunter (2-4) after Donaldson walked. Smoak was 2-for-4 with three RBIs.
Dominic Leone (3-0) got the win after allowing three hits and the tying run in the eighth and Roberto Osuna pitched around a single to earn his 32nd save.
The Blue Jays (59-62) won three games in the four-game series and hold a 9-7 lead in the season series over the Rays (60-63).
Toronto starter Chris Rowley allowed four hits, five walks and two runs in five-plus innings. The right-hander struck out three in his second career major league start.
Rays right-hander Chris Archer allowed five hits and three runs while striking out 10 in seven innings.
Donaldson hit a solo homer to open the scoring, his 10th first-inning home run of the season.
The Blue Jays scored again in the third.
Darwin Barney reached first base on a wild pitch after striking out. Norichika Aoki singled, a drive deflected by Archer and Smoak hit an RBI single.
The Rays scored on the fourth when Adeiny Hechavarria walked and Mallex Smith tripled.
Donaldson hit his 20th homer of the season in the fifth. It was his 13th career multi-homer games.
Rowley was replaced by Aaron Loup in the sixth after a leadoff walk to Wilson Ramos.
Corey Dickerson and Hechavarria singled to load the bases and Danny Barnes replaced Loup.
Pinch hitter Trevor Plouffe popped out and Brad Miller's groundout to first base forced Hechavarria at second as Ramos scored to cut the lead to 3-2.
Tim Mayza replaced Barnes with one out in the seventh and allowed a single by Logan Morrison before ending the inning with two strikeouts.
Leone allowed a run in the eighth on a one-out single by Peter Bourjos and a two-out double by Evan Longoria that tied the game 3-3. Duda was walked intentionally and Steven Souza Jr. singled to load the bases before Morrison grounded out to second.
NOTES: Rays RHP Chris Archer recorded career strikeout No. 1,000 against Blue Jays C Miguel Montero in the fourth inning Thursday. ... Blue Jays INF Ryan Goins (right forearm abrasion) played shortstop Thursday after leaving the game Wednesday in the sixth when he was out at second base as Rays SS Daniel Robertson stepped on his forearm. ... Rays CF Kevin Kiermaier (right hip fracture) was 0-for-3 with a walk as the DH Wednesday for Single-A Charlotte on a rehab assignment and could rejoin the Rays this weekend.