The rookie also made a key defensive play in the top of the ninth for the Orioles, who moved 18 games over .500 (80-62) for the first time since the end of the 1997 season.
Baltimore started the day tied atop the division with the New York Yankees, who beat Boston 5-4. The Orioles will seek to complete a three-game sweep of Tampa Bay on Thursday.
B.J. Upton homered for the Rays, who fell three games behind the Orioles and Yankees. Tampa Bay stranded 11 and went 2 for 10 with runners in scoring position.
Machado led off the ninth with a single off Kyle Farnsworth (1-5), took second on a bunt and scored when McLouth hit a liner off the right-field wall.
Jim Johnson (2-1) got the win.
YANKEES 5, RED SOX 4
BOSTON (AP) — Curtis Granderson hit two home runs, Robinson Cano also homered and New York defeated Boston to remain tied for first place in the AL East.
The Yankees finished the game without Derek Jeter, who left in the eighth after pulling up lame running out a double-play grounder to end the inning.
Manager Joe Girardi said Jeter wanted to stay in the game, but he told the shortstop to go put ice on his foot. Girardi said it was a bone bruise, but Jeter said it was a sprained ankle that was no big deal.
David Phelps (4-4) gave up one run in 5 2-3 innings, striking out five. Rafael Soriano got four outs for his 37th save, but not before allowing a solo homer to Jarrod Saltalamacchia to lead off the ninth.
Aaron Cook (3-10) allowed three runs in five-plus innings. Saltalamacchia had a double, a triple, a homer and a walk for Boston, which lost for the 12th time in 14 games.
TIGERS 8, WHITE SOX 6
CHICAGO (AP) — Max Scherzer pitched six effective innings to earn his career-high 16th win, Prince Fielder hit a three-run homer and Detroit beat Chicago to move within a game of the first-place White Sox in the AL Central.
Scherzer (16-6) allowed a run and four hits, including the first of two homers by Kevin Youkilis. The right-hander struck out seven to increase his major league-leading total to 220 and improved to 10-1 over his last 14 starts.
The series finale Thursday night features a pair of aces, with Detroit's Justin Verlander facing White Sox lefty Chris Sale.
Fielder hit his 26th homer in the seventh against reliever Leyson Septimo, snapping an 0-for-18 slump and giving the Tigers a 6-1 lead.
Youkilis belted a three-run shot off Joaquin Benoit in the eighth to get the White Sox within three. Jose Valverde earned his 30th save in 34 chances.
Chicago starter Gavin Floyd (9-10), activated from the disabled list earlier in the day, pitched well for the first four innings but gave up three runs in the fifth.
RANGERS 5, INDIANS 2
ARLINGTON, Texas (AP) — Josh Hamilton and Adrian Beltre homered before each left the game with injuries, and Texas beat the slumping Cleveland Indians.
Hamilton was removed as a precaution in the eighth inning with a sore left knee.
Beltre hit a two-run homer in the first, his 13th in 20 games, before exiting in the fifth with a strained left shoulder. He was scheduled for an MRI.
Ryan Dempster (11-6) of Gibsons, B.C., won his fifth straight start and improved to 6-1 since he was acquired by the Rangers from the Chicago Cubs on July 31. The right-hander allowed two runs and struck out eight in seven innings.
Joe Nathan, who has converted his last 31 save opportunities, pitched the ninth for his 33rd save of the season.
Hamilton hit a 434-foot solo shot in the third. He leads the majors with 41 home runs and 121 RBIs.
Cleveland led the AL Central on June 23 but is 15-43 since the All-Star break. Jeanmar Gomez (5-8) allowed five runs and six hits in four innings.
ATHLETICS 4, ANGELS 1
ANAHEIM, Calif. (AP) — A.J. Griffin threw eight scoreless innings, becoming the second Athletics pitcher in 85 years to start his major league career with six straight wins, and Yoenis Cespedes homered to help Oakland beat Los Angeles.
The Athletics, who can sweep the four-game series by beating Angels ace Jered Weaver on Thursday, have won 15 of 18 and are 22 games over .500 (82-60) for the first time since the 2006 club finished 93-69.
The A's won their 12th consecutive road game, matching the 1971 squad for the longest streak since the club relocated from Kansas City to Oakland in 1968. The franchise record is 14 in a row, set in May 1931.
Oakland's road winning streak is the longest in the majors since 2003, when Seattle won 13 straight away from Safeco Field.
Griffin (6-0) struck out six and walked none in the longest of his 11 career starts. The 24-year-old right-hander, one of four rookies in the A's rotation, lowered his ERA to 1.94 in his third start off the disabled list.
Sean Doolittle gave up a leadoff homer in the ninth by Albert Pujols before Ryan Cook got the final out for his 14th save. Pujols became the first major league player with 30 homers in each of his first 12 seasons and tied Stan Musial and Willie Stargell for 28th place on the career list with No. 475.
Ervin Santana (8-12) was charged with two runs — one earned — and four hits over six innings.
ROYALS 10, TWINS 5
MINNEAPOLIS (AP) — Billy Butler had three hits and three RBIs, and Kansas City's bullpen picked up struggling starter Luke Hochevar with four scoreless innings in a victory over Minnesota.
Hochevar (8-13) won for the first time in eight starts, but he gave up five runs on six hits with four walks in five innings. Tim Collins pitched two innings before Kevin Herrera and Francisley Bueno finished the game.
P.J. Walters (2-4) gave up six runs on seven hits in four innings and Twins left fielder Ryan Doumit was charged with three errors in the eighth to help the Royals put the game out of reach.
Joe Mauer missed his second straight game because of back spasms for the Twins.
Salvador Perez homered and drove in two runs for the Royals, who sent 10 batters to the plate in their five-run fifth and another nine in a four-run eighth.
MARINERS 3, BLUE JAYS 2
TORONTO (AP) — Miguel Olivo hit a solo home run and Kevin Millwood won consecutive starts for the first time since May as Seattle beat Toronto.
Edwin Encarnacion hit his 39th homer, a two-run drive into the second deck, but it wasn't enough to keep Ricky Romero (8-14) from losing his 13th straight decision. The Blue Jays managed only two hits against five Mariners pitchers.
Millwood (6-12), who entered 1-6 in nine career starts at Toronto, allowed two runs and two hits in five innings to win back-to-back starts for the first time since winning three straight from May 13-23. The right-hander, who walked one and struck out three, has won just three of 19 starts since. He was lifted with stiffness in his pitching shoulder.
Shawn Kelley and Josh Kinney each worked 1 1-3 innings for Seattle, and Oliver Perez got one out. Tom Wilhelmsen earned his 26th save in 29 chances.Suggest a correction