When a famine gripped the land, a different one from the first famine that occurred in Abraham's time, Isaac set out toward Gerar and toward King Abimelech of the Philistines.
The LORD appeared to him and said, "Don't go down to Egypt but settle temporarily in the land that I will show you.
Stay in this land as an immigrant, and I will be with you and bless you because I will give all of these lands to you and your descendants. I will keep my word, which I gave to your father Abraham.
I will give you as many descendants as the stars in the sky, and I will give your descendants all of these lands. All of the nations of the earth will be blessed because of your descendants.
I will do this because Abraham obeyed me and kept my orders, my commandments, my statutes, and my instructions."
So Isaac lived in Gerar.
When the men who lived there asked about his wife, he said, "She's my sister," because he was afraid to say, "my wife," thinking, The men who live there will kill me for Rebekah because she's very beautiful.
After Isaac had lived there for some time, the Philistines' King Abimelech looked out his window and saw Isaac laughing together with his wife Rebekah.
So Abimelech summoned Isaac and said, "She's your wife, isn't she? How could you say, ‘She's my sister'?" Isaac responded, "Because I thought that I might be killed because of her."
Abimelech said, "What are you trying to do to us? Before long, one of the people would have slept with your wife; and you would have made us guilty."
Abimelech gave orders to all of the people, "Anyone who touches this man or his wife will be put to death!"
Isaac planted grain in that land and reaped one hundred shearim that year because the LORD had blessed him.
Isaac grew richer and richer until he was extremely wealthy.
He had livestock, both flocks and cattle, and many servants. As a result, the Philistines envied him.
The Philistines closed up and filled with dirt all of the wells that his father's servants had dug during his father Abraham's lifetime.
Abimelech said to Isaac, "Move away from us because you have become too powerful among us."
So Isaac moved away from there, camped in the valley of Gerar, and lived there.
Isaac dug out again the wells that were dug during the lifetime of his father Abraham. The Philistines had closed them up after Abraham's death. Isaac gave them the same names his father had given them.
Isaac's servants dug wells in the valley and found a well there with fresh water.
Isaac's shepherds argued with Gerar's shepherds, each claiming, "This is our water." So Isaac named the well Esek because they quarreled with him.
They dug another well and argued about it too, so he named it Sitnah.
He left there and dug another well, but they didn't argue about it, so he named it Rehoboth and said, "Now the LORD has made an open space for us and has made us fertile in the land."
Then he went up from Gerar to Beer-sheba.
The LORD appeared to him that night and said, "I am the God of your father Abraham. Don't be afraid because I am with you. I will bless you, and I will give you many children for my servant Abraham's sake."
So Isaac built an altar there and worshipped in the LORD's name. Isaac pitched his tent there, and his servants dug a well.
But Abimelech set out toward him from Gerar, with Ahuzzath his ally and Phicol the commander of his forces.
Isaac said to him, "Why have you come after me? You resented me and sent me away from you."
They said, "We now see that the LORD was with you. We propose that there be a formal agreement between us and that we draw up a treaty with you:
you must not treat us badly since we haven't harmed you and since we have treated you well at all times. Then we will send you away peacefully, for you are now blessed by the LORD."
Isaac prepared a banquet for them, and they ate and drank.
They got up early in the morning, and they gave each other their word. Isaac sent them off, and they left peacefully.
That day Isaac's servants informed him about the well that they had been digging and said to him, "We found water."
He called it Shibah; therefore, the city's name has been Beer-sheba until today.
When Esau was 40 years old, he married Judith daughter of Beeri the Hittite, and Basemath daughter of Elon the Hittite.
They made life very difficult for Isaac and Rebekah.