Ray Rice had welts on his forehead and upper right arm. He needed to douse his eyes with drops to clear them of dirt and sweat. After more than three hours of playing in stifling heat and humidity, the Ravens diminutive running back looked like a man who needed a shower followed by a long nap.

Rice’s afternoon mirrored that of the Ravens, who were able to exhale only after Miami Dolphins kicker Caleb Sturgis sent a 57-yard field-goal attempt wide left with 38 seconds to go. The miss, which came a little over a minute after Justin Tucker’s 44-yard field goal had given the Ravens a three-point lead, secured the Ravens’ 26-23 victory in front of an announced 68,342 at Sun Life Stadium.

“We do make it difficult at times, but it just feels good to win on the road, especially with what we went through last week,” Rice said. “It was definitely a grind against a good football team.”

In improving to 3-2 and earning their first road win in three tries this season, the Ravens reaped the rewards of a commitment to the run game. A week after running the ball just nine times in a loss to the Buffalo Bills, the Ravens ran 40 times for 133 yards, 100 of the yards coming in the second half.

Rice, who carried the ball just five times against the Bills, had 27 carries, persevering through a shaky first half that included his fifth lost fumble in his past eight games to score two rushing touchdowns and gain 102 all-purpose yards.

“We are a very good team when he touches the ball,” said rush linebacker Terrell Suggs, who had three of the Ravens’ six sacks, all of his coming in the fourth quarter. “If it ain’t broke, don’t fix it. I love it when [Rice] and also [Bernard Pierce] is toting that thing. When you got a two-headed monster like that, [our] defense loves it when we’re using them.”

Rice’s second touchdown of the day -- this one from three yards out to finalize an 11-play, 94-yard drive -- gave the Ravens a 23-13 lead with just over 12 minutes to play and provided another opportunity for their purple-clad supporters who descended on South Florida in droves to drown out the Dolphins' fans.

But a flurry of mistakes, some by players and one big one by the coaching staff, allowed the Dolphins (3-2) to score 10 points to tie the game in just 1:35, setting the stage for the frantic finish.

On third-and-6 from Miami’s 24, Dolphins tight end Charles Clay got free of safety James Ihedigbo and caught Ryan Tannehill’s pass for a 45-yard gain. Four plays later, Sturgis cut the Ravens’ lead to 23-16 with a 50-yard field goal.

On the ensuing possession, the Ravens faced third-and-22 from their 9-yard line. It seemed like a perfect time to run the ball and send punter Sam Koch back on the field, putting the game back on the shoulders of the defense. After all, the Ravens were backed up to their goal line, quarterback Joe Flacco had been pummeled all day behind a shaky offensive line and the defense had allowed only a second-half field goal.

Instead, Flacco took the ball out of the shotgun and as he attempted to throw the ball to Deonte Thompson, Dolphins rookie Dion Jordan hit the quarterback’s arm. The ball fluttered and Dolphins safety Reshad Jones ran under it and returned it for a touchdown.

“We want that one back,” Ravens coach John Harbaugh said. “That was a mistake. We should have run the ball there. I think we’ll all agree. We should have punted it out there the way our defense was playing. We put Joe in a tough spot.”

Following the score, the two teams traded punts before the Ravens got the ball back at their own 40 with 4:07 to go. Flacco handed the ball to Rice or Pierce on five of six plays with the only exception being a 14-yard completion to Torrey Smith (six catches for 121 yards). That set up Tucker’s 44-yarder which broke the deadlock. Tucker was 4-of-4, also hitting from 42, 50 and 25 yards.

“To be able to put ourselves in that position where we have the upper hand in the two-minute drill, that’s big time for us,” said Tucker, who is now 11-for-13 on the season.

The game appeared all but over when Tannehill started the next possession with three straight incompletions and then found himself running for his life on fourth-and-10 from the Dolphins’ 20. However, he dropped a pass over the head of Ihedigbo and into the hands of a diving Brandon Gibson, putting the ball all the way down to the Ravens’ 34.

The Dolphins’ offense hustled to the line of scrimmage and Tannehill spiked the ball to stop the clock. But on second down, he was sacked by Elvis Dumervil before throwing an incompletion on third down. Facing fourth-and-15 from the Ravens’ 39, Dolphins coach Joe Philbin sent Sturgis onto the field. The kick had the distance but it sailed left of the upright.

“Every single game in the NFL is tough and every single game is important because of the amount of games we play,” said Flacco, who completed 19-of-32 passes for 269 yards. “It always comes down to one or two games at the end so to come down here and respond the way we did and get a win against a good football team is definitely going to be huge for us down the road.”

Suggs was quick to point out that the Ravens will need to be better next Sunday when the Green Bay Packers come to M&T Bank Stadium. Still, there was plenty to feel good about afterward.

Playing in difficult conditions, the Ravens won a game in which they had just three wide receivers active. They won despite the fact that starting left guard Kelechi Osemele played just one series because of back spasms, and left tackle Bryant McKinnie struggled for much of the afternoon in likely his last start before Eugene Monroe takes over.

They won by turning the game over to a running attack that had produced little more than frustration for the Ravens this season, and that angst continued in the first half yesterday when the Ravens ran the ball 15 times for 33 yards. But offensive coordinator Jim Caldwell stuck with the running game and watched it wear out the Dolphins’ defense during four second-half scoring drives.

“To be able to let our offensive linemen line up and try to get after a few people, that felt pretty good,” Rice said. “Jim didn’t let his foot off the pedal. No matter how it looked, we were going to run the ball. That’s a good feeling.”