Rays rally past Pirates 8-6