Egyptian Tale of Two Brothers:

Bata served his elder brother Anubis like a son. Bata had prodigious strength and the power to understand
 animals.  One day as they were plowing, Anubis sent Bata back to the house for more seed. 
The wife was smitten with mighty Bata and tried to seduce him, only to be rejected: 
"You are like a mother to me and your husband  like a father...". 
Virtuous to a fault, he promised not to tell her shame.

But she faked a beating (swallowing rancid fat to induce vomiting) and when Anubis returned she told him
 that Bata had raped her.

So Anubis waits in ambush in the stable. But the lead cow warns Bata and he flees.

Re-Harakhti intervenes and draws a river full of crocodiles between Bata and his pursuer.
From the far side of the river Bata protests his innocence. And to prove his claim he calls Re to witness and
 castrates himself (penis and all) casting the genitals into the river. 
Anubis is thus convinced of his innocence. 

Thereupon Bata weakens and seems to depart this life, journeying to the Valley of the Pine (?),
telling his brother that he must come to resurrect him when a sign appears.  When Anubis finds that beer
ferments in his cup, he will know that Bata has perished and he must go to save him.

For Bata will take out his heart and lodge it in the pine flower (?) at the top of the tree. 
When the sign comes to him, Anubis must go and find the heart and restore it to life in a basin of water.

Anubis returns home, kills his wife and gives her carcase to the dogs.

Bata in the Valley of the Pine is blessed by the Ennead. On order of Re, Khnum fashions for Bata a 
wife of supreme beauty, "the ichor of every  god is in her."

But it is not a happy match, for "she sat in the house while he spent the days hunting desert game."
He warned her not to go outside, "lest the sea snatch you. I cannot rescue you ...
because I am a woman like you...?"

Nonetheless she ventures out, the tide surges around her and captures a tress of her hair
 (that snagged on the pine); and the sea then carries the tress back to Egypt. There the fragrance 
of the tress so permeates  the waters that the clothing of pharoah becomes scented from washing in it.

Pharoah learns from his scribes that this tress belongs to "a daughter of Re-Harakhti in whom is the ichor
 of every god." So he sends out envoys to search for her; she is found in the valley of the pine and brought 
back to Egypt. There she delights the king and demands that he send soldier to cut down the great pine 
(wherein is the heart of Bata)

The next day when Anubis takes his barley beer, it ferments in his cup; he takes wine and it sours. 
So, recognizing the sign, he sets out for the Valley of the Pine. There he finds Bata's body and searches 
3 years for the heart. When he has nearly given up he finds it, puts in a basin of water.

And as the heart soaks the water, the body of Bata takes life and twitches. Anubis gives him the basin 
to drink, and his heart is restored. The two brothers are reunited.

Then by Bata's plan, they  journey to Egypt, Bata himself disguised as a great Bull, Anubis riding on 
his back. Pharoah is impressed and honors Anubis.

But Bata the Bull reveals himself to the Wife (now wife of Pharoah) and she contrives to have him 
slaughtered by tricking pharoah into a promise; she demands, "let me eat the liver of this bull."
  At his slaughter two drops of the blood soak into the earth at the doorposts of the palace, and 
there two great Persea trees spring up, one on either side.

Again Bata, now in the Persea tree, reveals himself to the treacherous Wife. And again she tricks pharoah 
into promising, now to cut down the trees and make furniture for her.  But when the trees are felled, 
a splinter of the wood flies off and lodges in her mouth, and she becomes pregnant from it.

Pharoah dotes upon the child as his son; he (Bata incarnate) rises to be Crown Prince. 

When Pharoah dies, the new Pharoah--Bata triumphant-- condemns the treacherous wife--and mother!  
He elevates Anubis to Crown Prince. And after his reign of 30 years, at Bata's death, Anubis succeeds him.