After possessing baseball's best record for most of the year, the last thing the Oakland Athletics expected was to head into Game 162 with their postseason fate uncertain.
Oakland can guarantee a playoff berth with a win Sunday as Sonny Gray takes the mound against the Texas Rangers.
The A's (87-74) had a 3 1/2-game lead in the AL West when they traded a package of quality prospects to the Chicago Cubs for starters Jeff Samardzija and Jason Hammel on July 4.
They still owned baseball's best mark at the July 31 trade deadline when they dealt slugger Yoenis Cespedes to Boston in a blockbuster deal that landed starter Jon Lester and outfielder Jonny Gomes.
Despite those moves, the A's have gone 15-30 since Aug. 10, conceded the division title to the Los Angeles Angels and now need either a victory or Seattle loss to the Angels just to sneak into the postseason.
Oakland fell 5-4 to the Rangers on Saturday before the Mariners stayed alive with a 2-1, 11-inning win over Los Angeles. If the clubs tie for the second wild card, they would play a one-game playoff Monday in Seattle.
At best, the A's will travel to either Kansas City or Detroit for Tuesday's wild-card game. It's certainly not an ideal situation, but Oakland will have to make do.
''These things are tough,'' manager Bob Melvin said. ''It takes a while to digest these things, and you move on to whatever the next scenario is.''
Oakland will turn to Gray (13-10, 3.21 ERA) as it hopes to lock up the second wild card without any help.
Gray went 12-3 with a 2.65 ERA through his first 21 starts and had won five straight after beating Texas on July 26. He's 1-7 with a 4.31 ERA in 11 outings since that victory, most recently suffering a tough-luck 2-0 loss to the Angels on Tuesday despite giving up one earned run and striking out a career-high 12 in seven innings.
"That's what he does," catcher Stephen Vogt said. "I don't think anybody's ever worried about Sonny. I looked up in the fifth and he had 10 punchouts. Pretty remarkable."
The right-hander has pitched at least seven innings in three of his last four outings, with the lone shorter start in that stretch coming against the Rangers on Sept. 18. Gray, who went 3-1 with a 1.82 ERA in his first four starts against Texas this season, gave up five runs in five innings of a 7-2 defeat.
The Rangers (67-94) hope to get to Gray again as they close their most disappointing season since going 62-99 in 1985. They've played extremely well of late under interim manager Tim Bogar, though, winning 13 of 15 after Saturday's victory.
Nick Martinez will get one more chance to audition for a spot in next season's rotation and is 2-1 with a 2.12 ERA over his last five starts. Martinez (5-11, 4.61) allowed two runs in 5 2-3 innings to beat Gray and the A's before pitching 6 2-3 scoreless innings of Tuesday's 2-1 home win over Houston.
The rookie right-hander had gone 0-6 with a 7.28 ERA in his first eight home starts.
''Early in the season, you could see him let the game speed up on him,'' Bogar said. ''He didn't allow that to happen.''
Martinez is 1-0 with a 2.30 ERA in two starts and one relief appearance against Oakland, which is 8-10 against the AL-worst Rangers this season.