ST. PETERSBURG -- In the middle of what would turn into a 7-6 series-winning victory at Tropicana Field on Sunday afternoon, A's right-hander Sonny Gray had a breakthrough on the mound.

This was no small discovery, even if the adjustment itself was a small one, considering Gray's ongoing struggles of late.

Oakland's ace rounded back into form in the latter parts of his 5 2/3-innings outing against the Rays, making both visual and mechanical tweaks that helped him keep the ball down and showcase the kind of movement that's typically associated with his pitches.

Following Evan Longoria's leadoff home run to begin the fifth, the third long ball allowed by him on the day, Gray retired five of his final six batters with ease.

"I can walk away from here with my head held high and really walk away confident and ready to go," Gray said. "I've constantly been leaving the ball up, and you can tell. It was literally just a visual thing to get the ball back down, and you could tell there, when it's back down, it's got great life on it, and you start to see the swing and misses.

"It was just a little thing that I've done in the past, and we've been working on that, and I finally just committed back to it there once the homer was given up."

Brandon Guyer was responsible for the first two homers, the latter following a costly two-out error by second baseman Tyler Ladendorf that resulted in three unearned runs.

Gray allowed three earned runs, scattering six hits with two walks and four strikeouts to lower his ERA from 6.00 to 5.84.

"I think Sonny pitched way better, especially later in the game too," A's manager Bob Melvin said. "His issue's been getting the ball up, and that's when his ball flattens out a little bit. He gets the ball down, then he has a lot of good movement on it, and you don't see the hard contact. He pitched better as the game went along there at the end. I think he found something."

"He got his movement down in the zone back," catcher Stephen Vogt said, "and I think for him he felt it and was excited when he came out of the game."

Gray, an All-Star last season, was 0-3 with a 12.79 ERA and .362 opponents' average in his previous three starts, allowing 18 earned runs across 12 2/3 innings in that span.

Never before have the A's seen him struggle in such a way, magnifying the significance of Sunday's progress.

"He's our stop guy," Vogt said, "and that's why today was such a big game in more ways than one, for him to even give us a chance to win like he always does, to fight back."

Jane Lee has covered the A's for MLB.com since 2010.