Gomes homers in 12th inning, A's beat Rays 4-3