Armia gave Finland a 3-1 lead at 12:47 of the second while killing a penalty. He cruised into the slot unmarked while three Swedish players contested with Erik Haula for puck control along the boards. The puck squirted out to Armia, who flipped it past Gustavsson.
Rantanen scored into an empty net from inside his blue line with 35 seconds remaining in the game to make it 4-1.
Slovakia (2-0-0-0), which beat Italy, 3-2, on Friday, leads the group with six points. Sweden and Finland each have three points. Italy (0-0-2-0) is fourth.
The top team in each of the three groups and the second-place team with the most points advance directly to the quarterfinals. The other eight teams play in a qualification round on Tuesday.
Sweden finishes Group B play against Slovakia on Saturday (6:10 a.m. ET; Peacock, ICI TOU.TV, CBC Gem, SN, RDS). Finland plays Italy in its final preliminary-round game Saturday (10:40 a.m. ET; Peacock, USA, ICI Télé, CBC Gem, SN, CBC).