The Arizona Diamondbacks traded left-hander Robbie Ray and cash considerations to the Toronto Blue Jays for left-hander Travis Bergen on Monday.
The Blue Jays also acquired infielder Jonathan Villar from the Miami Marlins, a source told ESPN's Jeff Passan.
Ray is 1-4 with a 7.84 ERA in seven starts this season. He is 48-50 with a 4.25 ERA in seven seasons, six of which have been with Arizona.
Villar is hitting .272 with two home runs and nine RBIs. He also is tied for the National League lead with nine stolen bases. Last season he hit a career-high 24 home runs while with the Baltimore Orioles.
Ray, 28, and Villar, 29, are both scheduled to be free agents in the offseason.
He is the second starting pitcher acquired before the deadline by the Blue Jays, who also acquired right-hander Taijuan Walker from the Seattle Mariners late last week.
Walker won his Toronto debut on Saturday in the Blue Jays' 5-0 victory over the Baltimore Orioles.
Bergen, who has pitched 1⅔ innings for the Blue Jays this season, was optioned to the team's alternate training site on Friday.
The Blue Jays (18-14) enter Monday's games in third place in the AL East standings.