
According to the Mahamayuri sutra of Pancaraksha, there was a bhiksu called venerable Svati. He was newly ordained in the Buddhist community of monks. He was unfortunately bitten by a poisonous snake and fainted. On seeing his condition venerable Ananda reported this incident to Buddha Shakyamuni. Lord Buddha, out of compassion for the newly ordained monk and the future ones, disclosed a dharani which was capable of eliminating poisonous harm and malignant diseases. This was the dharani of Arya Mahamayuri.
There is another story about this deity. There was a golden King peacock in the Himalayan mountain who used to recite Mahamayuri dharani with great devotion. It so happened one day that this king went along with his family to travel in the mountain forgetting to recite the dharani that day. He was caught by hunters. Thinking of his forgetfulness of the dharani he immediately began to recite and was able to free himself. The Buddha told Ananda that the peacock king called Suvarnavabhasa (i.e. golden coloured one) was none other than Buddha Shakyamuni himself. Thus this dharani is believed to be efficacious in all cases of dangers as well as for relieving poisonous harms. (by http://www.himalayanmart.com/mahamayuri.php)

孔雀明王有許多不同的形象,主要除了三面六臂的形象,還有依《大孔雀明王畫像壇場儀軌》所載一面四臂的形象︰「於蓮華胎上畫佛母大孔雀明王菩薩。頭向東方,白色,著白繒輕衣。頭冠、瓔珞、耳璫、臂釧,種種莊嚴,乘金色孔雀王,結跏趺坐白蓮華上或青綠花上,住慈悲相。有四臂,右邊第一手執開敷蓮華,第二手持俱緣果,左邊第一手當心掌持吉祥菓,第二手執三、五莖孔雀尾。」在胎藏界曼荼羅中,此尊被安置於蘇悉地院南端的第六位。
孔雀明王的經典主要是《孔雀明王經》,有許多不同譯本,包括:失譯者名的《大金色孔雀王咒經》一卷、《佛說大金色孔雀王咒經》一卷、梁代僧伽婆羅三藏法師譯的《孔雀王咒經》二卷、姚秦鳩摩羅什三藏法師譯的《孔雀王咒經》一卷、唐代義淨三藏法師譯的《佛說大孔雀咒王經》三卷、唐代不空三藏法師譯的《佛母大王經》三卷。其中義淨三藏法師與不空三藏法師的兩個譯本,經文比較完整,也都非常通暢達意。
另外還有《孔雀經等真言梵本》、唐代不空三藏法師譯的《佛說大孔雀明王畫像壇場儀軌》。
《孔雀護衛經》這部是上座部佛教早晚課必誦的,記載世尊的前生還是修行菩薩時期有一世是孔雀明王,並非叫金耀文中的金耀指的是太陽神,因為與其他孔雀與眾不同,導致許多獵人要捕捉孔雀明王(釋迦牟尼佛的前身),可是孔雀明王每天早晚禱告太陽神和諸佛以及了脫生死的聖人保佑平安祈求文,獵人們就沒有抓住。後來獵人在孔雀的發情期間抓了許多雌孔雀並嚇打這些雌性發出叫聲,由於孔雀明王很久沒交配一聽到雌性叫聲忘了念誦祈禱文,一下子衝過去就被抓了孔雀明王十分懊惱再度想起祈禱太陽神諸佛解脫聖人的護衛文,一直念誦奇蹟般的逃跑了。(from Wikipedia)