Being afflicted by an evil spirit of the dead are usually categorized under the condition of Gastkramad in the Swedish trolldom tradition. The word gastkraming consists of the word Gast - Eng. "ghost" - and kramad - Eng. "hugged". So a litterar translation of this spiritual condition would be "hugged by a ghost".
On May 27, 1741 the famous Swedish botanist Carl von Linnaéus wrote down this troll formula against gastkramning during this trip to Öland;
Wår Herre Chrest och Santa Peer
De ginge seg den wäjen fram
Så möter dem en döer man
Då sa wår Herre å Santa Peer
Te den döa Mannen
Hwa ska du gå?
Den döa Mannen sa
Ja ska gå te N. –. [patientens namn]
Hwa ska du där?
Sa wår Herre å Santa Peer.
Ja ska krysta honom så hierta-bloet ska rotas
Näj dä ska ja förwäira dei
Ja ska lägga deke under ståk och stojin
Så at du ska giöra ingen man mojin.
Our Lord and Saint Peter
They went along the road.
Then they meet a dead man.
Then our Lord and St. Peter said to the dead man;
- Where are you going?
The dead man said;
- I am going to N. -. [the name of the patient]
- What are you going to do there? said our Lord and St. Peter.
- I am going to squeeze him so his heart-blood rots.
- No! That I will refuse you!
- I will put you under a log and stone.
so you can harm no man.
Troll formulas such as this are usually accompanied by washing the patient with alcohol or water, by anointing them with a salve, giving them something to eat over which the formula has been read or a combination of all these methods.
Detailed descriptions on traditional Scandinavian ways to remove evil spirits of the dead and much more can be found in the book "Trolldom - Spells and methods of the Norse folk magic tradition" by yours truly.