Halt Undead will stop the shadow in its tracks.
Holy Word, Blasphemy, Dictum, Word of Chaos will also damage or destroy true neutral characters so any high level divine spellcaster can hose the whole party and the shadow at the same time with these.
Holy Smite, Unholy Blight, Chaos Hammer, Order's Wrath all deal damage to neutrals too (although less than to characters with more extreme alignments).
High level spells like Sunburst and Sunbeam will also take out the Shadow and the party at once.
For simple protection though, I'd go with Protection From Evil/Magic Circle Against Evil or Invisibility to Undead. All of those would make the shadow ineffective without killing it.