Matt Moore remained unbeaten, although he put the Rays in an early hole by giving up two runs in the first inning.
Tampa Bay, however, produced 13 hits and built a 10-2 advantage through six innings.
Longoria had an RBI single during a three-run first that quickly rallied the Rays in front. Tampa Bay broke things open with a four-run sixth that featured a two-run homer from Kelly Johnson.
Moore (6-0) allowed two runs on six hits with four walks over five innings to get the victory and snap Toronto's three-game winning streak.
Toronto players received good news earlier in the day when it was announced that J.A. Happ was recovering and had been released from a local hospital. Happ was struck on the head by a batted ball Tuesday and had to be carried off the field on a stretcher.
Ricky Romero (0-2) was on the mound for Toronto Wednesday and he was removed after retiring only one batter in the first. He was charged with three runs on four hits and walked two.
Florida bear attack: Black bear mauls woman's face
Toddler uninjured after being knocked over by Obama family dog