An Egyptian dream book inscribed in the reign of Ramses II, in the 13th century BCE, contains a ritual for turning away the negative energy of "bad" dreams and the psychic forces at play in them.
The hieratic papyrus classifies different types of dream as “good” or “bad”; the word “bad” is written in red, the color of ill omen in the Egyptian imagination.
What to do about a "bad" dream?
First, the dreamer is counseled to rub his face with bread soaked with beer, herbs and myrrh. Presumably this was intended to draw "bad" energies (maybe hungry ghosts) into a container that could be safely disposed of later. Bread and beer are gifts of the Goddess, so we are already in her realm.
Next, the dreamer is advised to tell his dream to Isis, addressed as Mother. The act of telling the dream to the Great Mother is held to disperse its evil. In the Gardiner translation, Isis says:
Come out with what you have seen, in order that the afflictions you saw in your dreams may vanish.
The ritual ends with a triumphal cry from the dreamer that he has dispelled an evil dream sent against him and is now ready to receive pleasant dreams. “Hail to thee, good dream that is seen by night or day!”
The dream book was found with a collection of magical and literary papyri in the cemetery at Deir el-Medina. The original author and owner are uncertain; at one time the papyrus belonged to a scribe named Qeniherkhepshef; who copied a poem about the Battle of Kadesh, which took place in the reign of Ramesses II (1279-1213 BC) on the verso.
Quotes above from A.H. Gardiner, Hieratic Papyri in the British Museum. Third Series. (London: British Museum, 1935).
Image: shabti of Qeniherkhepshef, the scribe who once possessed the Dream Book. The figure is depicted as a mummy standing like Osiris, gripping the crook and flail of kingship, but also two hoes, suggesting he is available for agricultural work. A
shabti (literally, "answerer") was a magical doll intended to work on behalf of the deceased in the afterlife, once activated by a spell. The spell to make the shabti "answer" is painted in horizontal lines around the figure, starting with hieroglyphs that identify the owner by the title, "Scribe in the Place of Truth".