The loss was Miami's season-worst eighth in a row.
Still seeking his first big league win, Koehler notched his third straight quality start, allowing three runs on seven hits in a career-high eight innings.
"It's nice," Koehler said. "It shows that they have confidence in me to go out there and face that lineup for the start of a fourth time. It's tough to sit here and say I'm happy, because I'm not. I'm not happy with giving up two runs in the first inning and putting the team in a hole. I'm happy I was able to go eight strong and keep them in the game. But at the same time, I'm frustrated with myself, putting them in a hole early."
The right-hander settled down after allowing three straight hits to start the game, giving up only one run on four hits in his final seven innings.
Marlins manager Mike Redmond praised Koehler's maturity in handling early adversity.
"He was able to go to his breaking ball and his changeup quicker than probably he wanted to, but it was effective and it worked for him," Redmond said. "After he started mixing in some curveballs and that changeup, he really settled in and pretty much breezed through the rest of that game."
Koehler added: "I have to do a better job of mixing my pitches from the get-go, especially to guys who we know are fastball hitters."
Koehler's early troubles proved costly in his third loss, as Rays starter Roberto Hernandez delivered a season-best performance.
Hernandez won the pitchers' duel, giving up one unearned run on three hits, with no walks and five strikeouts in 8 2/3 innings. He retired 15 of the final 16 batters he faced.
The Tampa Bay righty used his sinker ball to great affect, recording 12 ground ball outs.
"We got a lot of quick outs," Redmond said. "We weren't able to work counts on him. He threw a lot of strikes, and we were aggressive in the strike zone. We just weren't able to get hits."
Added second baseman Derek Dietrich: "He had a lot of movement on his sinker tonight. We hit the ball hard a few times, and they made plays. We've got to keep grinding. He pitched a good game for them. We had a couple of opportunities. Unfortunately, we didn't put enough across to win tonight."
Although Miami had a tough night at the plate, one of its three hits marked an offensive milestone.
Marcell Ozuna extended his hitting streak to 14 games with an infield single in the fourth. The hit added on to what was already the longest active streak in the Majors and tied the right fielder for the third best streak by a Marlins rookie.
Edgar Renteria boasts the franchise rookie record, stringing together a 22-game streak in 1996.
Chris Coghlan also continued his recent tear, extending his hitting streak to five with a leadoff double in the first. Coghlan swung at the second pitch he saw, rounded first base without hesitation and slid into second just ahead of the tag.
One pitch later, Coghlan tagged up and headed to third on Placido Polanco's fly out to right. Matt Joyce's throw bounced past Evan Longoria and into the Miami dugout, allowing Coghlan to cut Tampa Bay's lead to 2-1.
Coghlan's night at the plate was better than his 1-for-4 line indicated, Redmond said.
"I think every at-bat he had today, he hit the ball on the screws," the manager said.
Ozuna was the only other Marlins player to reach scoring position, as he stole second after reaching base on an infield single in the fourth.
The Marlins' tough night comes on the heels of two consecutive six-run showings against the Rays on Monday and Tuesday at Tropicana Field.
Despite Wednesday night's three-hit showing, Miami's recent offensive surge has given Dietrich confidence moving forward.
"We hit some balls hard today. We really did," Dietrich said. "We're starting to click. This lineup is starting to score runs. Today we didn't score as many as the last couple of nights, but we're putting good at-bats together, and we're hitting throughout the lineup.
"I think we're going to keep grinding it out, keep getting runners on and putting more runs across than we have been."