Mononoke (物の怪) are vengeful spirits (onryō), dead spirits (shiryō), live spirits (ikiryō), or spirits in Japanese classical literature and folk religion that were said to do things like possess individuals and make them suffer, cause disease, or even cause death. It is also a word sometimes used to refer to yōkai or henge ("changed beings").
Mononoke can be often seen in literature of the Heian period. As a famous example, in the 9th volume of the Genji Monogatari, "Aoi", is the ikiryō of Lady Rokujo, who possessed Aoi no Ue. Other than that, there are also statements about mononoke in publications like Ōkagami and Masukagami.
In those times, when medical knowledge has not been fully developed, people like monks and shugensha would perform incantations and prayers against diseases caused by mononoke, and by temporarily moving the mononoke into a different person called the "yorimashi" (usually servants, apprentices, etc.) they would perform exorcism on the mononoke to heal the illness. Statements on this practice can be found in detail in works like the The Pillow Book and The Diary of Lady Murasaki. Also, according to the Shoku Nihon Kōki, it told of once when a monk chanted a sutra to 60 people within the imperial residence.
Japanese "mononoke" come from China's 物怪, and there are statements on them in ancient Chinese literature like Records of the Grand Historian and 原鬼, there are statements on this 物怪. In the latter one, there is the statement, "those with neither voice nor shape are 鬼神 (fiendish gods). Those who cannot have shape or voice, and also cannot be without shape or voice, are 物怪," and thus the 物怪 of China at that time were considered a type of yōkai that cannot be seen or heard, and were thought to be natural phenomena that people did not understand with the knowledge of those times.
The first appearance of it in Japanese literature is seen to be in the Nihon Kōki, and according a quotation of this book from the Nihon Kiryaku of the same time period, in the article of Uruu 12th month of the year Tenchō 7 (830), there is the statement "five monks were invited to recite the Diamond Sutra. With some difficulty, the Jingi-kan relieved it. It was the work of a 物恠," and there are also statements about mononoke in the articles in the 8th month Jinshin of the same year, and of year 10 in the 5th month. In the old language of those times, the word "mono" was used to refer to oni, spirits, or Ara-mitama among other things, or things that were not felt to be clearly real, and in the Taihō Code, epidemic diseases were written about as "toki no ke" (時気), using the word "ke" to refer to "diseases," and so it is seen that a "mono no ke" (a "ke" of a "mono") was used to refer to diseases caused by these "mono." "The Pillow Book" as well, there are names for diseases such as "mune no ke" ("ke" of the chest), "ashi no ke" ("ke" of the feet), and "mono no ke" ("ke" of "mono").
As groundwork for how "mononoke" were thought of as, in Japan from the beginning of the Heian Period, varaious societal malaises and illnesses were thought to be due to curses ("tatari") of vengeful spirits (onryō). Starting with how the succession of emperors dying to diseases and the spread of epidemics in the Enryaku years was said to be the curse of Prince Sawara, there is a tale in the Nihonkoku Genpō Zen'aku Ryōiki in which the grudge of Prince Nagaya is said to have led many people to their deaths. In the Shoku Nihongi, there is a statement about Fujiwara no Hirotsugu's vengeful spirit (onryō). However, this kind of thought still wasn't very influential at that time, and even Emperor Saga stated in a caution, "in this society, some would attribute any and all mononoke to a spirit's curse. These are very baseless assertions," thus strongly denying the relation between mononoke and vengeful spirits.
Afterwards, in the Shoku Nihon Kōki, the author, Harusumi no Yoshitada, reflecting knowledge of onmyōdō, strongly adopted the concept of mononoke. In the Jōwa years, the aristocratic society received strong influence from onmyōdō, and the spread of onmyōdō planted in many people the general concept of vengeful spirits. Just at that time, after Sugawara no Michizane died in Engi 3 (903), the deaths one after another that followed of members of the imperial and noble families, as well as the spread of epidemic diseases, were feared as the work of a curse of Michizane, and thus the belief that mononoke were caused by vengeful spirits' curses grew even stronger.
Afterwards, in the era of the Fujiwara sekke, as opposed to how noble families at that time boasted of glory, they had delicate personalities, and so due to fear of the grudges and revenges of the era's defeated ones, and due to misgivings about the future, fear of mononoke became more aroused. The locked-in lifestyle of the imperial society at that time also fostered in the nobles' minds fear of mononoke. In this way, mononoke themselves were thought to be vengeful spirits, and eventually in addition to epidemic diseases, individual deaths, illnesses, and pain were all seen to be due to mononoke, and the illnesses itself also became called mononoke. Furthermore, due to the concept of the fear of "mono," the things that were said to be the origin of the illnesses, the ikiryō and shiryō themselves, were also thought to have been called "mononoke."