The Russians will play the either Canada or Slovakia on Monday night at Air Canada Centre.
Ziat Paigin and Maxim Mamin had the other Russian goals. Lucas Wallmark scored the lone goal for Sweden.
New York Rangers draft pick Igor Shestyorkin made 26 saves in the win while Linus Soderstrom stopped 27 shots in the loss.
It was the third time in the last four years the two countries met in a semifinal at the Under-20 tournament. Sweden had won the previous two meetings.
Russia scored twice a little over a minute apart in the second period.
Sharov opened the scoring with his third of the tournament at 11:18 putting an Anatoli Golyshev feed past Soderstrom.
Paigin made it 2-0 lead at 12:50 one-timing a feed from Toronto Maple Leafs prospect Rinat Valiev for his first of the tournament.
Vyacheslav Leshenko had an excellent chance to give the Russians a 3-0 lead with just 39 seconds remaining in the period, but Soderstrom got his shoulder on it to direct it over the net.
Sharov's second of the game 1:31 into the third put it out of reach. The 19-year-old draft-eligible forward picked up a pass from Vladimir Bryukvin and beat Soderstrom with a wrist shot.
Wallmark got Sweden on the board with his fourth of the tournament at 11:30 of the third.
However, Mamin put home the rebound off of Ivan Fishenko's shot at 12:39 restoring Russia's three-goal lead with his second goal of the tournament.
Sweden, which won silver losing to Finland at the gold medal game at the tournament last year, now has a shot at bronze on Monday. Sweden also defeated Russia 3-2 during the preliminary round on Dec. 29. Russia won Bronze at last year's event defeating Canada 2-1.