Max Scherzer could only watch as the lead, and another shot at his 20th victory, slipped away.
Avila hit two home runs, including a tiebreaking shot in the eighth inning that lifted Detroit over the Kansas City Royals, 3-2, Sunday. Scherzer was in line for his 20th victory when reliever Drew Smyly (6-0) allowed the Royals to tie the score in the top of the eighth, but Avila answered with a drive to right-center field for his 11th home run.
Scherzer has two losses and two no-decisions since a 19-1 start. He gave up a run and five hits with 12 strikeouts and one walk in seven innings Sunday. He was on track to become the first 20-game winner in the majors this year.
Oakland took a 61/2 -game division lead with two weeks left. The A's have won five games in a row and 13 of 16.
Texas is 2-11 in September after beginning the month with a two-game division lead. The Rangers lost their sixth game in row, all at home. This was their first winless homestand of at least six games since moving to Texas in 1972.
The Rangers and the Tampa Bay Rays are tied for the two AL wild-card spots. Texas starts a four-game series at Tampa Bay on Monday.
Rays lose after blowing lead against Twins
Joel Peralta (2-8) gave up a home run to Ryan Doumit and a three-run home run to Josmil Pinto in the eighth inning, and the Rays stumbled again, this time with a 6-4 loss to the Minnesota Twins.
Tampa Bay, which had won its previous three games, wasted a 3-0 lead and dropped to 7-14 since Aug. 25. Minnesota had lost 11 games in a row to the Rays.
Left-hander Francisco Liriano took a no-hit bid into the seventh inning before faltering in his first no-decision this season, and pinch-hitter Justin Morneau singled in the go-ahead run in the eighth to lead the Pittsburgh Pirates over the Chicago Cubs, 3-2.
Pittsburgh remained tied with the St. Louis Cardinals for the National League Central lead, won three of four games in the series with the last-place Cubs and won for the sixth time in seven games. The Cardinals beat the Seattle Mariners, 12-2.