James Loney hit a go-ahead infield single in the 13th inning, and the Tampa Bay Rays outlasted the New York Yankees 3-2 Wednesday to avoid a three-game sweep.