UNDATED (AP) — Jeff Samardzija had been the unluckiest pitcher in the majors this season, going 0-4 in 10 starts, despite a major league-leading 1.46 ERA. That included three outings in which he pitched shutout ball, and seven starts in which the Cubs scored fewer than three runs.

The right-hander finally got a win on Memorial Day with one of his worst starts of the season as he allowed four runs over six innings of an 8-4 triumph over the Giants. The Cubs trailed 3-1 in the fifth before they scored seven times over three at-bats. Samardzija contributed to the Cubs' go-ahead rally in the fifth, tying the game with an RBI double before scoring on Emilio Bonifacio's triple. Darwin Barney had two RBIs to help the Cubs overcome Pablo Sandoval's two-run homer and three ribbies.

The Giants fell to 32-19, still the best record in the majors.

Hyun-Jin Ryu came within six outs of becoming the second consecutive Dodgers pitcher to throw a no-hitter. Ryu had a perfect game against Cincinnati until Todd Frazier led off the eighth with a double, one day after Josh Beckett threw the Dodgers' first no-hitter in 18 years.

The lefty gave up two more hits and a sacrifice fly before leaving with one out in the eighth inning of a 4-3 win over the Reds.

Ryu also contributed to the Dodgers' three-run seventh, hitting an RBI grounder and scoring on Carl Crawford's two-run double.

In other Memorial Day baseball:

— Jonathan Schoop homered twice and Nick Hundley singled home the go-ahead run in the 10th to lift Baltimore past the Brewers 7-6 in Milwaukee. The Orioles were one out from a 6-4 loss until Schoop went deep off Francisco Rodriguez and Nick Markakis followed with a game-tying double.

— Brian Roberts hit a tiebreaking single in a three-run 12th inning that pushed the New York Yankees past the Cardinals 6-4 in St. Louis. Brett Gardner drove in a run, scored once and made a leaping catch to rob Yadier Molina of a game-winning homer in the 11th.

— David Ortiz homered and drove in four runs as the Boston Red Sox rallied to beat Atlanta 8-6 and end their 10-game losing streak. The Braves enjoyed a 6-1 lead in the sixth until Dustin Pedroia lined a two-run single and scored on Ortiz's three-run blast.

— Giancarlo Stanton leads the National League with 15 homers after smacking a two-run shot in Miami's 3-2 win at Washington. Stanton is hitting .333 with 14 home runs and 27 RBIs in 129 at-bats in Washington since his career began in 2010.

— Ryan Howard crushed a two-run homer and drove in five runs as Philadelphia slaughtered Colorado 9-0. John Mayberry Jr. also hit a two-run shot and Kyle Kendrick blanked the Rockies on six hits over 6 2/3 innings.

— Arizona pulled out a 7-5 win over San Diego on A.J. Pollock's two-run homer with two out in the bottom of the ninth. Pollock scored twice and had three of the Diamondbacks' 10 hits.

— The New York Mets led the Pirates 2-0 until Gaby Sanchez cracked a pinch-hit solo homer in the eighth and a tiebreaking single in the ninth to send Pittsburgh to a 5-3 victory. Sanchez owns a career batting average of .324 with 34 RBIs against the Mets.

— Melky Cabrera was 3-for-3 with a walk and three RBIs in Toronto's seventh straight win, a 10-5 pounding of Tampa Bay. Dioner Navarro and Steve Tolleson hit back-to-back homers in the fourth, two innings before Edwin Encarnacion smacked his 15th homer of the season.

— Elvis Andrus and Chris Gimenez each had two RBIs as Texas whipped the Twins 7-2 in Minnesota. Nick Tepesch allowed two runs in 6 2-3 innings to win his second consecutive start.

— Dayan Viciedo hit a three-run homer and Conor Gillaspie collected four more hits in the Chicago White Sox's 6-2 win over Cleveland. Winning pitcher Jose Quintana gave up two runs and five hits in six innings.

— Oakland ended a season-high four-game losing streak by homering five times in a 10-0 romp over Detroit. Derek Norris launched a grand slam to back Tommy Milone, who allowed four hits in 6 2/3 innings.

— Robinson Cano is hitting .332 after going 3-for-4 with two RBIs in Seattle's 5-1 triumph over the Angels. Chris Young improved to 4-2 and pitched shutout ball until Albert Pujols homered in the seventh inning.

— George Springer was a major offensive contributor in Houston's 9-2 romp at Kansas City, going 4-for-4 with a solo homer, three RBIs and five runs scored. The rookie is hitting .433 with five homers and 13 RBIs during his eight-game hitting streak.

Hitting coach fired, Valverde cut

NEW YORK (AP) — The New York Mets fired hitting coach Dave Hudgens and cut reliever Jose Valverde after Monday's game against Pittsburgh. Minor league hitting coordinator Lamar Johnson will take over for Hudgens.

Ellis injured during Beckett celebration

LOS ANGELES (AP) — Dodgers catcher A.J. Ellis has gone on the 15-day disabled list with a sprained right ankle, a day after getting hurt while celebrating Josh Beckett's no-hitter in Philadelphia.

Ellis had rushed to join his teammates around home plate when he stepped on the discarded helmet.