Kershaw's gem gave the Dodgers the only two no-hitters in the majors this season. Josh Beckett tossed one May 25 in Philadelphia.
Cheered on by his wife in the stands, Kershaw (7-2) retired his first 18 batters before Corey Dickerson led off the seventh with a slow bouncer to Ramirez. His throw on the run went wide past first baseman Adrian Gonzalez for a two-base error - ending any chance for a perfect game.
But that was it for the Rockies against Kershaw, a two-time NL Cy Young Award winner. And he came oh-so-close to throwing the 22nd perfect game since 1900.
DETROIT (AP) - Kansas City won its 10th straight game, extending its best streak in 20 years with help from Jeremy Guthrie and a lucky hop.
The Royals have not won this many games in a row since a run of 14 straight in 1994. They extended their AL Central lead over the Tigers to 1 1/2 games.
Guthrie (4-6) allowed four hits and struck out nine in 6 2-3 innings. Drew Smyly (3-6) nearly matched him, but the Detroit left-hander was hurt by Alex Gordon's RBI single that deflected off second base in the first and a solo homer by Omar Infante in the fifth.
J.D. Martinez homered for the Tigers in the seventh, but the Kansas City bullpen got the last seven outs, with Greg Holland pitching the ninth for his 21st save in 22 chances.
Kansas City will try for a four-game sweep Thursday.
SAN DIEGO (AP) - Pinch-hitter Tommy Medica singled in the go-ahead run in the eighth inning for San Diego in its first home game since Hall of Famer Tony Gwynn died of cancer Monday.
The light-hitting Padres honored Gwynn before the game and then cobbled together just enough offense for their second win in 10 games.
Starters Felix Hernandez and Andrew Cashner pitched well but didn't get a decision. Hernandez struck out 10 and allowed only three singles in seven innings, with no walks. But he allowed the Padres to tie it at 1 on a wild pitch with two outs in the sixth.
Everth Cabrera started the winning rally by beating out an infield single on a chopper against Charlie Furbush (0-4). Cabrera was sacrificed over by Alexi Amarista and scored on Medica's liner to center. James Jones throw home was late and off line.
CHICAGO (AP) - Jose Abreu hit his 20th homer, a two-run shot, and Adam Dunn added a three-run drive to help Chicago hand San Francisco its fifth straight loss.
White Sox ace Chris Sale (6-1) gave up three runs and eight hits in six-plus innings. Ronald Belisario got five outs for his seventh save.Abreu reached 20 homers in his 58th game, the third-fewest in major league history behind Wally Berger (51) and Mark McGuire (56). Chicago swept the two-game series.
Giants starter Tim Hudson (7-3) allowed seven runs and 12 hits in 4 2-3 innings, his shortest outing this season. He entered with a major league-best 1.81 ERA.
WASHINGTON (AP) - Anthony Rendon homered to spark a three-run seventh inning, and pinch-hitter Nate McLouth came through with a tiebreaking sacrifice fly as Washington rallied past Houston for a two-game sweep.
The Nationals extended their NL East lead to 1 1/2 games over Atlanta and Miami. They open a four-game series against the Braves on Thursday night in Washington.
Ian Desmond hit a key double off Kyle Farnsworth in the seventh. Darin Downs (1-1) took the loss.
ST. LOUIS (AP) - Bartolo Colon worked eight dominant innings in 91-degree heat and keyed the go-ahead rally with his first career extra-base hit, helping New York beat St. Louis to avoid a three-game sweep.
Eric Young Jr. and David Wright each had an RBI in a two-run sixth that put the Mets up by a run. Young added an RBI double in the seventh, aided by Colon's second sacrifice of the game. A day after dropping their sixth straight series in St. Louis, the Mets ended an eight-game road losing streak dating to June 3.
Matt Carpenter hit his third career leadoff homer for the Cardinals, who lost for the second time in nine games. They had just one runner in scoring position against the 41-year-old Colon (7-5), who retired 13 in a row before Daniel Descalso's two-out single in the eighth.
Colon surprised Lance Lynn (7-5) with a double to open the sixth. The pitcher had been 0 for 43 at the plate since June 10, 2005, when he singled for the Angels against the Mets. He scored his second career run, and first since 2002 with the Expos, when Young followed with a double.
Colon won his fifth straight decision and needed just 86 pitches. He allowed four hits and walked none.
Left-hander Dana Eveland retired lefty swinging Matt Adams with a runner on for his second career save. The other came in 2005.
MIAMI (AP) - Jake Arrieta had a career-high 11 strikeouts in seven innings, and Nate Schierholtz hit a three-run homer to lead Chicago over Miami.
By taking the rubber game of the three-game set, the last-place Cubs won consecutive road series for the first time since June 2013.
Marlins slugger Giancarlo Stanton hit his NL-leading 20th homer in the first but left the game after six innings with a bruised left wrist. Stanton said the injury wasn't serious, and he expected to be back in the lineup Thursday.
Arrieta (3-1) allowed five hits and one walk, lowering his ERA to 1.98. He also doubled for his first career extra-base hit.