The D-backs will not have to include any cash in the deal, with the Rays picking up the roughly $1.6 million Qualls is owed for the rest of the season.
Arizona has actively shopped Qualls, who began the year as the team's closer, but has struggled to find any consistency and is 1-4 with an 8.51 ERA in 42 games. The right-hander, who makes $4.185 million this year, will be eligible for free agency at the end of the season.
The D-backs acquired Qualls along with Juan Gutierrez and Chris Burke from the Astros in December 2007 in a deal that sent Jose Valverde to Houston.
Steve Gilbert is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.