The Rays will now have four players at this year's game in Anaheim, as Soriano joins Evan Longoria, Carl Crawford and David Price.
Because Rivera, who has a left oblique injury and right knee inflammation, was elected via the player ballot, his replacement was the next-highest-ranking relief pitcher. Soriano ranked fourth among relief pitchers on the AL player ballot with 67 votes.
"I'm very happy for Soriano," Rays manager Joe Maddon said. "He deserved to be there in the first place. I know it's tough to pick an All-Star team. I've done it. But he definitely deserves to be there. ... He's basically been perfect all season.
"We would not have 50 wins without him. We would not be in this position without him. And furthermore, this entire bullpen would not be pitching this well without him. So that's what he's meant to us to this point."
Soriano said he got the news from his agent early in the afternoon.
"To me, I'm not here for trying to make the All-Star team, I'm here to try [and help the Rays] win," Soriano said. "At the same time, I get the opportunity to be there, I'm happy with that and my family, too."
The 81st Major League Baseball All-Star Game will be televised nationally by FOX Sports, in Canada by Rogers Sportsnet and Sportsnet HD and Le Reseau des Sports, and around the world by Major League Baseball International, with pregame ceremonies beginning at 8 p.m. ET. ESPN Radio will provide exclusive national radio coverage. MLB Network, MLB.com and Sirius XM also will provide comprehensive All-Star Game coverage.
Soriano, who came to the Rays in a December trade with the Braves, picked up his 23rd save of the season Tuesday night against the Red Sox, which was his fourth save in as many days. The right-hander has converted 23 of 24 saves this season for a Major-League best 95.8 save percentage.
Soriano is 2-0 with a 1.65 ERA and has 29 strikeouts and just seven walks in 32 2/3 innings.
Bill Chastain is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.