When Husham died, Hadad, son of Bedad, took over as king. He was the one who defeated the Midianites in the country of Moab, and the name of his town was Avith.
So when the Ishmaelites (who were traders from Midian) came by, they pulled Joseph out of the pit and sold him to them for twenty pieces of silver. The Ishmaelites took him to Egypt.
In the meantime the Ishmaelites had arrived in Egypt and had sold Joseph to Potiphar. Potiphar was one of Pharaoh's officers, the captain of the guard.
They left Midian and went to Paran. Then, along with some people from Paran, they went to Egypt, to Pharaoh king of Egypt. He provided Hadad with a house and food, and also assigned him land as a gift.
When three of Job's friends heard of all the trouble that had happened to him, they each left their homes: Eliphaz the Temanite, Bildad the Shuhite, and Zophar the Naamathite. They met together and went to comfort and console him.
and told the leaders of Midian, “This horde will eat up everything we have, just like an ox eats up grass in the field!” (Balak son of Zippor, was king of Moab at that time.)