Hernandez, who missed three weeks with a sore left oblique, hit his second homer of the season leading off the eighth in a 1-1 game.
''We all know that we needed a big hit like that. It came from my bat, but I know the other guys are going to keep hitting and we're going to get into a winning streak now,'' said Hernandez, who had 32 homers and 116 RBIs last season. ''It's been a long time for me without hitting a ball like that, especially since I was injured, but it's just about time.''
Jansen was activated Saturday after being sidelined for more than a month with a strained left oblique and hit his third homer in only his ninth at-bat this year. He reached base three times and lined out to the warning track in center field.
''He hasn't missed a beat,'' manager Charlie Montoyo said. ''He looked really good at the plate.''
Both homers came off Ryan Thompson (1-2), who also gave up singles to Santiago Espinal and Lourdes Gurriel Jr. in the decisive four-run inning that served as a sigh of relief for the Blue Jays.
''To have a four-run lead, that hasn't happened very often,'' Montoyo said. ''It was great to see the two-out hits. That's who we are. When you add on runs, then you don't have to play tight games.''
Tim Mayza (2-0) got the win in relief after striking out two of his three batters in the seventh.
Vladimir Guerrero Jr. singled in the first inning off Rays starter Ryan Yarbrough, extending his hitting streak to 11 games, and scored on Espinal's sacrifice fly.
Manuel Margot and Randy Arozarena had two hits each for Tampa Bay. Margot stretched his career-high hitting streak to 11 games, during which he is hitting .486.
Yandy Diaz led off the Rays first with an opposite-field, 333-foot home run off left-hander Hyun Jin Ryu for the Rays' only run. It was Diaz's third of the season.
Ryu, pitching for the first time since April 16 due to an inflamed left forearm, gave up one run on four hits in 4 2/3 innings, striking out three.
''I just wanted to make sure I went deep into the game,'' Ryu said through a translator. ''I regret the walk I gave up in the fifth inning more than the home run. If I didn't give up the walk, I could have finished the fifth.''
He threw 71 pitches.
''Besides the great win, it was great to see Ryu do what he did today,'' Montoyo said. ''What he did was perfect. That's what we needed. We'll go from there.''
Blue Jays: CF George Springer, who sprained his left ankle Friday night, did not play. Montoyo said Springer will play Sunday if the ankle feels better.
Rays: RHP Pete Fairbanks, who has been on the 60-day injured list all season with a right lat strain, threw a baseball for the first time Saturday.
EXTRA JUICE NEEDED
Before Hernandez's homer in the eighth, the Blue Jays had four balls caught at the warning track.
''Everybody knows how hard it is to hit a ball out of the park right now because of things that they've been doing to the baseball. It's obvious that they've changed the baseballs,'' Hernandez said. ''It's been hard, but I got that one pretty good.''
RHP Alek Manoah (4-0, 1.75), who beat the Rays three times last season and struck out 36 of the 98 Rays he faced in four starts, will pitch Sunday's series finale against LHP Jeffrey Springs (1-1, 2.12).
More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports
Copyright 2022 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.