Though originally counted as one of the first humans of Vedic lore, Yama later came to be regarded as an indignant deity and a protector of Buddhist principle.
One story regarding his origins describes how he had originally been a Tibetan saint. As a human he was decapitated by burglars who had slain a stolen bull. The saint then arose from the dead, placed the stolen bull's head on his neck in place of his own, and assumed the form of a ravenous demon. The demon would later be subdued and converted to Buddhism by Manjushri, who had taken the form of a demon far more terrifying then he, Yamantaka.
Shin Megami Tensei
The protagonist confronts Yama at a prison in Ikebukuro. On his way towards the site he is forcibly taken in by the Chaos Hero and presented to Yama to be judged.
If the player is of a Chaotic alignment, he will be released and allowed to roam the prison. However if his alignment sways more towards Law, he will be held in a cell to await judgement by the hands of Yama's court. If the character is Neutrally aligned then he'll be given a choice, to aid the forces of chaos or to be interred in the aforementioned prison cell. Yama can later be fused as a demon of the Tenma clan.
Shin Megami Tensei: Devil Survivor
Yama appears once more in Devil Survivor as a demon of the Deity clan. He acts as Keisuke's agent of justice upon commencement of the 4th day. The player may choose whether or not to kill Yama, or if certain conditions are not met, he and Keisuke will be slain by Kaido's Pazuzu.
The Genji and the Heike Clans
Yama can be found in the underworld of The Genji and the Heike Clans, accessible only upon falling into a pit or gap. He appears in the form of Enma Daioh, surrounded by a formation of chests that may restore Kagekiyo to life or immediately kill him.
"King Yama" is confronted upon completion of World 5 (Hell) in Spelunky, accompanied by a duo of minions known as Ox Face and Horse Head.