Chicago led 2-0 before a four-run sixth inning settled the issue.
Jim Thome had a huge day with a solo homer, two RBI singles and four hits overall. The home run was the 512th of his career, and the four hits equaled his single-game high.
Danks (2-1) gave up three singles in seven scoreless innings with no walks and eight strikeouts.
Logan gave up one hit over the final two innings.
Four players had one hit each for the Rays, who lost their second straight home series.
The losing pitcher was starter Edwin Jackson (2-2).