Odorizzi (2-2) struck out seven and walked three, plus delivered an RBI single for his first career hit. Logan Morrison had three hits and Brad Miller had two hits and two stolen bases for the Rays, who ended a three-game slide.
Giancarlo Stanton hit his 12th home run for Miami, snapping a 6-for-57 drought. Marcell Ozuna doubled twice and reached for the 31st consecutive game, while Justin Bour and Derek Dietrich added two hits for Miami.
Alex Colome got a two-inning save for the Rays, his 12th of the season.
Marlins starter Tom Koehler (2-5) allowed six hits and three runs in five innings, striking out six but walking five.