Cobb (7-2) ended his night by striking out Nick Frankiln on a full-count pitch with the bases loaded and two outs in the fifth. He received a standing ovation as he walked off the field. The right-hander gave up one run and three hits, striking out six and walking two,
Wil Myers, who had four RBIs, drove in two with a double and Evan Longoria added a two-run homer off Joe Saunders (10-12) that put the Rays up 5-1 in the fifth.
Cobb, activated from the 60-day disabled list before the game, sustained a concussion after being struck on the right ear by a liner hit by Kansas City's Eric Hosmer on June 15. He was taken off the field on a stretcher and was hospitalized overnight.
"Everybody goes through troubles," Cobb said in a prestart interview session with reporters on Wednesday. "If you let it wear you down and affect the way you think and affect the way you live, then it beat you. You got to beat the situation, and go out there and just be happy to be a back."
Yunel Escobar had a run-scoring single in the seventh for the Rays, who have won two in a row after a six-game losing streak. Alex Torres, Jamey Wright and Wesley Wright completed a five-hitter.
The decisive fifth for the Rays started when Sam Fuld lined a single to center that whizzed past Saunders. After Sean Rodriguez had a bloop single to center that fell between a couple of Seattle defenders, Myers and Longoria followed with their run-scoring hits.
Saunders allowed five runs and seven hits over 4 1-3 innings.
Raul Ibanez gave the Mariners a 1-0 lead in the second on his first homer since going deep twice on July 12. He has 25 homers this season.
Myers tied it at 1 with an RBI single during the third. He picked up his fourth RBI of the game on a run-scoring double during the eighth.
NOTES: Seattle manager Eric Wedge, recovering from what the team called a very mild stroke, could return during a homestand that starts Aug. 23. "He's passing everything with flying colors, he's feeling much better," acting Mariners manager Robby Thompson said. "There's a real good chance he will join us when we get back." ... As part of his season-long effort to keep his players loose, Rays manager Joe Maddon had a 20-foot python in the clubhouse before the game. ... To make room on the roster for Cobb, Tampa Bay designated INF Ryan Roberts for assignment