In Mazdaist traditions, in the beginning there were two spirits, Ahura Mazda and Ahriman. These two spirits were separated by a void. Ahura Mazda was thought to be characterized by goodness, light, and he was unlimited in time but not in space. He was free of all evil, and does not create or willingly tolerate evil. Ahriman was represented as evil and limited by time because he knew eventually Ahura Mazda would defeat him, and he was also limited by space.
Because there was a void separating the two, in the beginning, Ahura Mazda knew of Ahriman but Ahriman did not know of Ahura Mazda. Ahura Mazda wanted to free himself from his own limitation in space, but he knew that by doing so, he would have to initiate a struggle with Ahriman, which he did not want to do. In time, though, Ahriman saw a light across the void and envied and lusted for it. He then created the evil things of this world (such as the daevas) to fight against the good things Ahura Mazda created. Ahura Mazda offered Ahriman peace if Ahriman would worship the good things Ahura Mazda created, but Ahriman refused, and Ahura Mazda showed Ahriman his inevitable fate. Ahriman was stunned and fell into the void for a period of time. When he awakened, he engaged in war with Ahura Mazda, which Ahura Mazda won and finally destroyed Ahriman.
According to the Vendidad, Ahriman co-created the world with Ahura Mazda, countering evil with everything good Ahura Mazda created. He created "the serpent in the river, and Winter, a work of the Daevas," "the locust, which brings death unto cattle and plants," "plunder and sin," "the ants and the ant-hills," "the sin of unbelief," "tears and wailing," "the Pairika Knathaiti, who claves unto Keresaspa," "the sin of pride," "a sin for which there is no atonement, the unnatural sin," "the evil work of witchcraft," "the sin of utter unbelief," "a sin for which there is no atonement, the cooking of corpse," and "abnormal issues in women, and barbarian oppression". He also created creates 99,999 diseases.
He also attempted to maim the divine prophet Zarathustra. He first sent the demon Buiti to kill Zarathustra, but the prophet chanted aloud the Ahuna-Vairya, and the demon fled back to Ahrian. Ahriman himself then 'rushed forth from the regions of the North to lure away the Prophet from the path of righteousness,' but the prophet resisted the temptation and affirmed that he would never do the bidding of Ahriman.
Later texts refer to Ahura Mazda as having created six (sometimes seven) Amesha Spenta, or archangels. Angra Mainya also created a council of six (sometimes seven) archdemons. The archdemons (daevas) are known as Aka Manah, Indra, Sauru, Taurvi, Zairitsha, and Naonhaithya (the seventh is Aeshma).
Eventually, Ahriman will be defeated by the coming of a Saoshyant or Saviour. Ancient texts refer to three great souls who are designated to be Saoshyants. The third of these will destroy evil and bring forth the reign of righteousness. The coming is referred to in the Farvardin Yasht, which says he will be the son of Zarathustra and will be conceived through a virgin called 'the all-destroying' (Yasht xiii.142; Vendidad xix.5). He will be assisted by his friends, who are fiend-smitting, well-thinking, well-speaking, well-doing, and whose tongues have never uttered a word of falsehood (Yasht xiii.142).
After this, the world will be restored, the dead will arise, and life and immortality will come. With the disappearance of evil from the universe, good will prevail everywhere and for all time; and the accursed name of Angra Mainya will be forgotten. Ahura Mazda will be for ever, even as he has been from all eternity" (Yasht xix.11,12).==In the Avesta==
In Zoroaster's revelation
Avestan angra mainyu "seems to have been an original conception of Zoroaster's." In the Gathas, which are the oldest texts of Zoroastrianism and are attributed to the prophet himself, angra mainyu is not yet a proper name. In the one instance in these hymns where the two words appear together, the concept spoken of is that of a mainyu ("mind", "mentality", "spirit" etc.) that is angra ("destructive", "inhibitive", "malign" etc.). In this single instance—in Yasna 45.2—the "more bounteous of the spirits twain" declares angra mainyu to be its "absolute antithesis".
A similar statement occurs in Yasna 30.3, where the antithesis is however aka mainyu, aka being the Avestan language word for "evil". Hence, aka mainyu is the "evil spirit" or "evil mind" or "evil thought," as contrasted with spenta mainyu, the "bounteous spirit" with which Ahura Mazda conceived of creation, which then "was".
The aka mainyu epithet recurs in Yasna 32.5, when the principle is identified with the daevas that deceive humankind and themselves. While in later Zoroastrianism, the daevas are demons, this is not yet evident in the Gathas: In Zoroaster's view the daevas are "wrong gods" or "false gods" that are to be rejected, but they are not yet demons.
In Yasna 32.3, these daevas are identified as the offspring, not of Angra Mainyu, but of akem manah, "evil thinking". A few verses earlier it is however the daebaaman, "deceiver"—not otherwise identified but "probably Angra Mainyu"—who induces the daevas to choose achistem manah—"worst thinking." In Yasna 32.13, the abode of the wicked is not the abode of Angra Mainyu, but the abode of the same "worst thinking". "One would have expected [Angra Mainyu] to reign in hell, since he had created 'death and how, at the end, the worst existence shall be for the deceitful' (Y. 30.4)."
S.G.Talageri in his book Rigveda: A Historical Analysis says about the Rsis Angiras, Atharnanas, Bhrigus & Spitamas as "Hence, it is not the BhRgus or AtharvaNas as a whole who are the protagonist priests of the Avesta, it is only the Spitama branch of the Athravans. Hence, also, the name of the "good spirit", opposed to the "bad spirit" Angra Mainyu (a name clearly derived from the name of the ANgirases), is Spenta Mainyu (a name clearly derived from the name of the Spitamas)."
In the Younger Avesta
Yasna 19.15 recalls that Ahura Mazda's recital of the Ahuna Vairya invocation puts Angra Mainyu in a stupor. In Yasna 9.8, Angra Mainyu creates Aži Dahaka, but the serpent recoils at the sight of Mithra's mace (Yasht 10.97, 10.134). In Yasht 13, the Fravashis defuse Angra Mainyu's plans to dry up the earth, and in Yasht 8.44 Angra Mainyu battles but cannot defeat Tishtrya and so prevent the rains. In Vendidad 19, Angra Mainyu urges Zoroaster to turn from the good religion by promising him sovereignty of the world. On being rejected, Angra Mainyu assails the prophet with legions of demons, but Zoroaster deflects them all. In Yasht 19.96, a verse that reflects a Gathic injunction, Angra Mainyu will be vanquished and Ahura Mazda will ultimately prevail.
In Yasht 19.46ff, Angra Mainyu and Spenta Mainyu battle for possession of khvaraenah, "divine glory" or "fortune". In some verses of the Yasna (e.g. Yasna 57.17), the two principles are said to have created the world, which contradicts the Gathic principle that declares Ahura Mazda to be the sole creator and which is reiterated in the cosmogony of Vendidad 1. In that first chapter, which is the basis for the 9th–12th-century Bundahishn, the creation of sixteen lands by Ahura Mazda is countered by the Angra Mainyu's creation of sixteen scourges such as winter, sickness and vice. "This shift in the position of Ahura Mazda, his total assimilation to this Bounteous Spirit [Mazda's instrument of creation], must have taken place in the 4th century BC at the latest; for it is reflected in Aristotle's testimony, which confronts Ariemanios with Oromazdes (apud Diogenes Laertius, 1.2.6)."
Yasht 15.43 assigns Angra Mainyu to the nether world, a world of darkness. So also Vendidad 19.47, but other passages in the same chapter (19.1 and 19.44) have him dwelling in the region of the daevas, which the Vendidad asserts is in the north. There (19.1, 19.43-44), Angra Mainyu is the daevanam daevo, "daeva of daevas" or chief of the daevas. The superlative daevo.taema is however assigned to the demon Paitisha ("opponent"). In an enumeration of the daevas in Vendidad 1.43, Angra Mainyu appears first and Paitisha appears last. "Nowhere is Angra Mainyu said to be the creator of the daevas or their father."
In Zurvanite Zoroastrianism
Zurvanism was a branch of Zoroastrianism that sought to resolve the dilemma of the "twin spirits" of Yasna 30.3. The resolution, which probably developed out of the contact with Chaldea, was to have both Ahura Mazda and Angra Mainyu as twin sons of the First Principle "Time" (Avestan: Zurvan). Zurvanism was strongly criticized as a heresy during the Sassanid period (225-651) of Iranian history, an era in which it probably also had its largest following. Although the monist doctrine is not attested after the 10th century, some Zurvanite features are nonetheless still evident in present-day Zoroastrianism.
Zurvanism's principal feature is then the notion that both Ahura Mazda (MP: Ohrmuzd) and Angra Mainyu (Ahriman) were twin brothers, with the former being the epitome of good and the latter being the epitome of evil. Further, this dichotomy was by choice, that is, Angra Mainyu chose to be evil: "It is not that I cannot create anything good, but that I will not." And to prove this, he created the peacock.
The mythology of the twins is only attested in the post-Sassanid Syriac and Armenian polemic such as that of Eznik of Kolb. According to these sources the genesis saw Zurvan as an androgynous deity, existing alone but desiring offspring who would create "heaven and hell and everything in between." Zurvan then sacrificed for a thousand years. Towards the end of this period, Zurvan began to doubt the efficacy of sacrifice and in the moment of this doubt Ohrmuzd and Ahriman were conceived: Ohrmuzd for the sacrifice and Ahriman for the doubt. Upon realizing that twins were to be born, Zurvan resolved to grant the first-born sovereignty over creation. Ohrmuzd perceived Zurvan's decision, which He then communicated to His brother. Ahriman then preempted Ohrmuzd by ripping open the womb to emerge first. Reminded of the resolution to grant Ahriman sovereignty, Zurvan conceded, but limited kingship to a period of 9000 years, after which Ohrmuzd would rule for all eternity.
In Zoroastrian tradition
In the Pahlavi texts of the 9th-12th century, Ahriman (written ʼhl(y)mn) is frequently written upside down "as a sign of contempt and disgust."
In the Book of Arda Viraf 5.10, the narrator—the 'righteous Viraf'—is taken by Sarosh and Adar to see "the reality of God and the archangels, and the non-reality of Ahriman and the demons." This idea of "non-reality" is also expressed in other texts, such as the Denkard, a 9th-century "encyclopedia of Mazdaism", which states Ahriman "has never been and never will be." In chapter 100 of Book of the Arda Viraf, which is titled 'Ahriman', the narrator sees the "Evil spirit, ... whose religion is evil [and] who ever ridiculed and mocked the wicked in hell."
In the Zurvanite Ulema-i Islam (a Zoroastrian text, despite the title), "Ahriman also is called by some name by some people and they ascribe evil unto him but nothing can also be done by him without Time." A few chapters later, the Ulema notes that "it is clear that Ahriman is a non-entity" but "at the resurrection Ahriman will be destroyed and thereafter all will be good; and [change?] will proceed through the will of God." In the Sad Dar, the world is described as having been created by Ohrmuzd and become pure through His truth. But Ahriman, "being devoid of anything good, does not issue from that which is owing to truth." (62.2)
Book of Jamaspi 2.3 notes that "Ahriman, like a worm, is so much associated with darkness and old age, that he perishes in the end." Chapter 4.3 recalls the grotesque legend of Tahmurasp (Avestan: Taxma Urupi) riding Angra Mainyu for thirty years (cf. Yasht 15.12, 19.29) and so preventing him from doing evil. In Chapter 7, Jamasp explains that the Indians declare Ahriman will die, but "those, who are not of good religion, go to hell."
The Bundahishn, a Zoroastrian account of creation completed in the 12th century has much to say about Ahriman and his role in the cosmogony. In chapter 1.23, following the recitation of the Ahuna Vairya, Ohrmuzd takes advantage of Ahriman's incapacity to create life without intervention. When Ahriman recovers, he creates Jeh, the primal whore who afflicts women with their menstrual cycles. In Bundahishn 4.12, Ahriman perceives that Ohrmuzd is superior to himself, and so flees to fashion his many demons with which to meet Creation in battle. The entire universe is finally divided between the Ohrmuzd and the yazads on one side and Ahriman with his devs on the other. Ahriman slays the primal bull, but the moon rescues the seed of the dying creature, and from it springs all animal creation. But the battle goes on, with mankind caught in the middle, whose duty it remains to withstand the forces of evil through good thoughts, words and deeds. Other texts see the world created by Ohrmuzd as a trap for Ahriman, who is then distracted by creation and expends his force in a battle he cannot win. (The epistles of Zatspram 3.23; Shkand Gumanig Vichar 4.63-4.79). The Dadistan denig explains that God, being omniscient, knew of Ahriman's intent, but it would have been against His "justice and goodness to punish Ahriman before he wrought evil [and] this is why the world is created."
Ahriman has no such omniscience, a fact that Ohrmuzd reminds him of (Bundahishn 1.16). In contrast, in Manichean scripture, Mani ascribes foresight to Ahriman.
In present-day Zoroastrianism
In 1862, Martin Haug proposed a new reconstruction of what he believed was Zarathustra's original monotheistic teaching, as expressed in the Gathas—a teaching that he felt had been corrupted by later Zoroastrian dualistic tradition as expressed in post-Gathic scripture and in the texts of tradition. For Angra Mainyu, this interpretation meant a demotion from a spirit coeval with Ahura Mazda to a mere product of the Creator. Haug's theory was based to a great extent on a new interpretation of Yasna 30.3; he argued that the good "twin" in that passage should not be regarded as more or less identical to Ahura Mazda, as earlier Zoroastrian thought had assumed, but as a separate created entity, Spenta Mainyu. Thus, both Angra Mainyu and Spenta Mainyu were created by Ahura Mazda and should be regarded as his respective 'creative' and 'destructive' emanations.
Haug's interpretation was gratefully received by the Parsis of Bombay, who at the time were under considerable pressure from Christian missionaries (most notable amongst them John Wilson) who sought converts among the Zoroastrian community and criticized Zoroastrianism for its alleged dualism as contrasted with their own monotheism. Haug's reconstruction had also other attractive aspects that seemed to make the religion more compatible with nineteenth-century Enlightenment, as he attributed to Zoroaster a rejection of rituals and of worship of entities other than the supreme deity.
The new ideas were subsequently disseminated as a Parsi interpretation, which eventually reached the west and so in turn corroborated Haug's theories. Among the Parsis of the cities, who were accustomed to English language literature, Haug's ideas were more often repeated than those of the Gujarati language objections of the priests, with the result that Haug's ideas became well entrenched and are today almost universally accepted as doctrine.
While some modern scholars hold views similar to Haug's regarding Angra Mainyu's origins, many now think that the traditional "dualist" interpretation was in fact correct all along and that Angra Mainyu was always considered to be completely separate and independent from Ahura Mazda.