MIAMI — The Tampa Bay Rays did not record a hit until the sixth inning, did not score until the eighth and stranded nine runners on base in a 4-3 loss to the Miami Marlins at loanDepot park, the club’s ninth defeat in its past 12 games.

Tampa Bay finished 2-for-10 with runners in scoring position and fell to 6-17 when scoring three runs or fewer this season. The Rays loaded the bases with two outs in the ninth against reliever Tyler Zuber, with the tying run at third in Chandler Simpson, but Junior Caminero struck out swinging to end the game and cap an 0-for-5 day with three strikeouts.

“I was trying to put it in play,” Caminero said through interpreter Kevin Vera. “I was trying to be the hero, and it didn’t work out.”

Designated hitter Yandy Díaz provided the Rays’ best swings, delivering an RBI double in the eighth that cut the deficit to 4-1 and singling in a run during the ninth-inning rally. Díaz acknowledged the lineup’s recent struggles but pushed back against the idea the offense is broken.

“The bats were hot at the beginning of the year, and now they’re not necessarily as hot,” Díaz said through Vera. “But that doesn’t mean we’re not going to be a good offensive team. So right now, we’ve just got to keep at it, just keep having a good mindset and moving forward.”

The Marlins built their lead against starter Shane McClanahan, who cruised through four scoreless innings before Javier Sanoja pulled a first-pitch slider for a solo home run to open the fifth — only the third homer McClanahan has allowed in 12 starts this season. Joe Mack followed with a double off the left-field wall, and three consecutive singles in the sixth chased McClanahan before he could record an out. Reliever Casey Legumina limited the damage to a sacrifice fly in a bases-loaded, nobody-out situation.

“You get singled to death, and it just happens sometimes,” McClanahan said. “I was really proud of the way I competed. I’m proud of this team for battling and trying to come back like that.”

The ninth-inning rally came against former Rays closer Pete Fairbanks, who walked three batters and threw 39 pitches before Miami pulled him. Ben Williamson drew a leadoff walk, Taylor Walls reached on a bunt single, and Williamson scored on a wild pitch. Jonathan Aranda walked to load the bases after Díaz singled, but Caminero could not deliver the final blow.

“We had some good at-bats last night, and then today we had the middle of the lineup come up and their pitchers did a good job of making some big pitches,” manager Kevin Cash said. “Just had a bunch of good at-bats and didn’t do their pitcher any favors by expanding out of the zone. We just came up a little bit short right there at the end.”

The Rays and Marlins close their series at loanDepot park Sunday afternoon.