In the opener of a crucial three-game series, Oakland moved 4 1/2 games in front of the Rangers in the American League West. Texas has lost four in a row and finds itself drifting toward playoff elimination.
The Rangers hold down the first wild card spot, but are only one game in front of Tampa Bay and 2 1/2 games ahead of Cleveland.
Cespedes hit his home run in the first inning to put Oakland in front for good and Josh Donaldson added three RBI on a solo homer in the third and a two-run double in the fourth.
The Athletics pounded out 14 hits to give Dan Straily (10-7) the win. Straily gave up two runs on two hits in 5 2/3 innings. Sean Doolittle finally recorded the third out of the eighth inning and then worked the ninth as well to collect his second save.
Doolittle allowed a two-out double in the ninth, but then struck out Jurickson Profar to end the game.
Derek Holland (9-9) allowed six runs on eight hits in just three frames to take the loss.