BRADENTON, Fla. -- Rays starter Alex Cobb and two relievers combined on a four-hitter, and the Rays took advantage of a throwing error by novice third baseman Gaby Sanchez to score four unearned runs in the seventh inning to down the Pirates, 4-2, in spring baseball on Thursday.

Tampa Bay broke a scoreless tie in the seventh when Wil Myers hit a two-out grounder to Sanchez, making his first Grapefruit League start at third base, and his throw in the dirt avoided Brad Hawpe, in his first start at first. Sanchez's throwing error enabled Hak-Ju Lee, pinch-running for Chris Gimenez, who had doubled, to score.

Myers then scored on Mike Fontenot's single, and Tim Beckham followed with a double to make it 3-0. Justin Wilson relieved Jeanmar Gomez (0-2) and surrendered a single to Leslie Anderson to score Beckham.

Cobb, of the Rays (9-4), and the Pirates' James McDonald, traded zeros through four innings, with each allowing only one hit. Cobb was particularly overpowering, striking out five without issuing a walk, and allowing only Josh Harrison's two-out single in the third.

Chris Archer (1-0) pitched hitless ball for the next three innings, contributing to Tampa Bay's collective four-hitter. In two innings, Jake Odorizzi struck out three but also surrendered two runs in the bottom of the ninth.

Stretching out to four innings for the first time, McDonald gave up a game-opening single to Desmond Jennings, who then was promptly picked off first base by the right-hander. McDonald, who'd given up three homers to Baltimore in his previous start, walked three and had one strikeout.

The Pirates rallied in the ninth, as Matt Hague and Jared Goedert scored on a Russell Martin double, but they ultimately fell short.

Up next for Pirates: The Pirates host the Orioles on Friday in the lone night game (7:05 p.m. ET) on their McKechnie Field exhibition schedule. Kyle McPherson will continue his bid for a rotation spot in his third start, with Mike Zagurski, Kris Johnson and Bryan Morris among those scheduled to follow him to the mound. Watch the game live on MLB.TV.