I have yet to find anything a rail rifle can't fix. Even a force 12 spirit gets nervous around those.
Hence my comment to just kick the ass of your GM if rail rifle doesn't work, as the situation was obliviously a premeditated TPK on the part of him.
Rail rifle is after all deadly up to force 13, assuming you can hit that spirit.
To be fair, there are GM's who believe in a "persistent world" concept, namely the world exists and continues outside the PC's direct experiences. If the GM decided that a Force 20 fire spirit lives in the abandoned warehouse on fleet street, there's a Force 20 fire spirit in said warehouse. The GM's job at that point is to provide at least some hint that going in said warehouse is not a good idea. Unless they want to make a deal with said fire spirit.
Now, if the GM looked at his plans for tonight's run and said "this fight would be more fun for me with a Force 20 fire spirit", curb-stomp him.
OP, Max has already answered your question; however, if you're looking for how to map it out in the rules:
A critter with Immunity has an enhanced resistance to a certain type of attack or affliction. The critter gains an “Armor rating” equal to twice its Magic against that damage. This Immunity Armor is treated as “hardened” protection (see Hardened Armor above), meaning that if the Damage Value does not exceed the Armor, then the attack auto- matically does no damage.
...
Immunity to Normal Weapons: This immunity applies to all weapons that are not magical (weapon foci, spells, adept or critter powers). If the critter has the Allergy weakness, then the Immunity does not apply against non-magical attacks made using the allergen.
Hardened Armor is even tougher than normal armor. If the modified Damage Value of an attack does not exceed the Armor rating (modified by Armor Penetration), then it bounces harmlessly off the critter; don’t even bother to make a Damage Resistance Test. Otherwise, Hardened Armor provides both Ballistic and Impact armor equal to its rating.
So, a Force 4 spirit has Armor 8/8 against non-magical attacks, and if the attack fails to deal damage greater than the
modified armor rating, it's ignored.
Example:
Dude with Light Pistol (4P, 0 AP) shoots at Force 4 Beast Spirit, rolling a net of 2 hits on his attack.
4P + 2 = 6 < 8 Ballistic armor, attack ignored.
Example 2:
Dude with Light Pistol loaded with EX-Explosive (5P, -2 AP) shoots same spirit, rolling a net of 2 hits on his attack.
5P + 2 = 7 > 6 Ballistic armor (8 - 2 for AP), attack affects the spirit & it needs to roll for soak (Body 6 + Armor 6 = DP 12).
Elemental attacks (including electricity) all have Armor Piercing of -half (See pages 163 - 164, SR4A). Electricity is simply the cheapest / easiest one to acquire for your average mundane.
Example 3:
Dude with Taser (6S(e), -half) shoots same spirit, rolling a net of 2 hits on his attack.
6S + 2 = 8 > 4 Impact armor (8/2), attack affects the spirit & it needs to roll for soak (Body 6 + Armor 4 = DP 10)
These examples should make it pretty clear, if you're purchasing on the cheap, a taser or SnS is your friend against spirits. Not only is it the least expensive, it's the highest damage when you hold all other variables the same.
If you aren't purchasing on the cheap, get that gauss rifle, name it Vera and end that spirit.