Notes on magic in ancient Egypt
The Egyptian word for magic was heka, personified in the god Heka who stands on the sun boat with Ra.
Heka is also associated with the ba (soul) of Ra
Heka is the energy which made creation possible and every act of magic is a continuation of this creative process.
All magic invokes one or more relevant gods or spirits
Demons and spirits of the underworld are not intrinsically evil, though they may tend to act in ways that harm humans.
even Set, who killed Osiris, is not solely an evil force. Set accomplishes both good and evil things.
Magic relies heavily on the principle of similarity. However, this might not always work as you expect.
the power might come from the opposite of the effect that is desired, e.g. the god Set might be invoked as a protector, with the threat of his chaotic violence intended to keep away harmful influences that might violate the desired order. Or the Set charms might be invoking his role as protector of the chariot of Ra as it passes through the underworld. Set is called to battle every night as the chariot passes through the lair of the chaos serpent
A god might play more than one role in a spell, as the petitioner calls on multiple aspects of the god. e.g. the patient might be deemed similar to the wounded Horus (whose eyes were plucked out by Set and restored by Thoth or Isis), then later in the same spell Horus may be called on to use his healing powers to restore the patient.
Spell ingredients:
the milk of the mother of a son was used as a general ingredient in healing and protective spells