The Dodgers rallied against Lester and the Red Sox's bullpen for two runs in the eighth, but Los Angeles left two men on base in the inning and couldn't overcome the early four-run deficit.
"We got back in it, we just weren't able to break through," said manager Don Mattingly.
Ryu has been one of the Dodgers' more consistent starters this year, but he was shaky from the outset. He hit former Dodgers outfielder Shane Victorino with a pitch one out into the game, the first batter the left-hander hit in 155 2/3 innings in the Major Leagues. Dustin Pedroia and Mike Napoli followed with back-to-back singles to score Victorino, and Jonny Gomes took Ryu deep to left for a three-run shot on the first pitch.
Ryu had allowed four earned runs over his past three starts combined. Still, he settled in and retired seven straight Red Sox and 14 of 16 after Gomes' homer.
"I talked to Hyun-Jin after the first and it was kind of a tough situation giving up four, and he was pretty discouraged by it," said catcher A.J. Ellis. "But he did a great job giving us a chance to get back in the game. Unfortunately, we weren't able to come all the way back."
Mattingly lifted Ryu for a pinch-hitter in the bottom of the fifth inning. It was only the third time in 25 starts that Ryu did not make it to the sixth. He struck out seven, walked none, allowed five hits and threw 89 pitches.
Ryu developed a cold flying back from Miami on Thursday, but he said that did not factor in to his performance.
"The worst mistake I made today was giving up the three-run home run," Ryu said through translator Martin Kim.
Lester limited the Dodgers to three hits and one run over 7 1/3 innings. He struck out six against four walks and benefitted from strong defense behind him.
"For the most part, I was commanding the ball pretty well," said Lester, who is 4-1 with a 2.31 ERA in his last seven starts. "I was able to move the fastball around and get some weak contact from a good-hitting lineup."
Los Angeles was victimized by three double plays, twice with Yasiel Puig on first base. Gonzalez lined out to first and Puig was doubled off in the first inning. Mark Ellis flew out to short right with Puig attempting to steal second in the sixth. Mattingly said it was not a hit-and-run and called it "a miscommunication."
"It was something we didn't want to be doing," the manager said. "We're down four runs. You don't really want to do that."
Andre Ethier lined out to shortstop Stephen Drew with two on in the seventh, and Hanley Ramirez was doubled off second base. Ramirez appeared to be shaken up on the play, and he was favoring his left ankle. The shortstop remained in the game and fielded a grounder and threw to first with no issue in the next half inning.
"He did kind of turn his ankle a little bit, but not enough to get him out of the game," Mattingly said. "He said he was fine."
The Dodgers' bullpen was solid, as it has been since the All-Star break.
Carlos Marmol relieved Ryu and got four outs, three via strikeout. J.P. Howell followed with a pair of strikeouts in the seventh.
Brian Wilson made his Dodger Stadium debut as a member of the home team in the eighth. The former Giants closer received a warm reception. He allowed a double and single to put runners on the corners with one out, and walked the bases loaded with two outs before striking out Will Middlebrooks looking to end the threat.
Brandon League and Paco Rodriguez combined for a scoreless ninth.
"Our bullpen was tremendous," Mattingly said. "They kept us right there and gave us a chance to get back in the game."
But the Dodgers couldn't come up with another clutch hit after Gonzalez brought in Puig and Carl Crawford with a double in the gap off Red Sox left-hander Craig Breslow, and lost for just the sixth time in the second half.
Gonzalez leads the Dodgers with 16 homers and 80 RBIs. The first baseman has driven in at least 80 runs in eight consecutive seasons, joining Tigers sluggers Miguel Cabrera and Prince Fielder as the only players with at least 80 RBIs in each season since 2006.
"He always has a great plan at the plate," A.J. Ellis said. "He spends more time in the video room checking out the guys he thinks he's going to face more than anybody we have on the team. He's a student of the game and he hits to the situation extremely well."