OAKLAND, Calif. (AP) – Sonny Gray struck out six pitching into the seventh in what might have been his final home start in Oakland if the club tries to deal him before the trade deadline, and the Athletics rallied in the fifth inning to beat the Tampa Bay Rays 7-2 on Wednesday.

Matt Joyce hit a towering homer to the right-field seats in the eighth for Oakland.

READ MORE: Ring Videos Show Creepy Encounters By Man At Home of Sacramento Mother And Her Children

Rajai Davis doubled home Oakland’s first run in the fifth then Joyce followed with a tying sacrifice fly before Davis scurried home with the go-ahead run on a wild pitch.

Gray (6-4) won his third straight start and fourth in five. When speculation arose from the White Sox side before his Friday outing that the right-hander had been scratched because of a possible deal, the A’s quickly announced that he was indeed taking the mound for his scheduled outing.

After a pair of one-run defeats to begin this series, the A’s avoided being swept by the Rays in Oakland for the first time. This already marked just their third lost series at home to Tampa Bay.

Gray allowed two runs and seven hits in 6 1/3 innings with two walks.

READ MORE: 'I Thank God': More California Churches To Offer Vaccines In Effort To Reach Underserved Communities

The Rays got three straight singles off Gray to start the fourth inning, including an RBI single by Wilson Ramos. Brad Miller also drove in a run on a groundout.

But Oakland finally got to Tampa Bay right-hander Jake Faria (4-1) in the fifth. With seven straight quality starts to begin his career, Faria took his first big league loss.

A’s All-Star Yonder Alonso hit an RBI single in the inning, when Faria had two of his four walks. He allowed six hits and four runs in five innings, striking out four.

Alonso was thrown out at home in the first when he tried to go from first on Khris Davis’ double to right. The throw beat him so handily Alonso didn’t even try to slide and instead ran behind the plate before turning for the dugout.

MORE NEWS: 'A Trend That Won't Go Away': Sacramento City Leaders Consider Permanent Plans For Street Dining

(© Copyright 2017 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)