There was a famine in the land in addition to the earlier one during Abraham's time. So Isaac went to King Abimelech of the Philistines in Gerar.
The LORD appeared to Isaac and said, "Don't go to Egypt. Stay where I tell you.
Live here in this land for a while, and I will be with you and bless you. I will give all these lands to you and your descendants. I will keep the oath that I swore to your father Abraham.
I will make your descendants as numerous as the stars in the sky and give all these lands to your descendants. Through your descendant all the nations of the earth will be blessed.
I will bless you because Abraham obeyed me and completed the duties, commands, laws, and instructions I gave him."
So Isaac lived in Gerar.
When the men of that place asked about his wife, Isaac answered, "She's my sister." He was afraid to say "my wife." He thought that the men of that place would kill him to get Rebekah, because she was an attractive woman.
When he had been there a long time, King Abimelech of the Philistines looked out of his window and saw Isaac caressing his wife Rebekah.
Abimelech called for Isaac and said, "So she's really your wife! How could you say, 'She's my sister'?" Isaac answered him, "I thought I would be killed because of her."
Then Abimelech said, "What have you done to us! One of the people might have easily gone to bed with your wife, and then you would have made us guilty of sin."
So Abimelech ordered his people, "Anyone who touches this man or his wife will be put to death."
Isaac planted [crops] in that land. In that same year he harvested a hundred times as much as he had planted because the LORD had blessed him.
He continued to be successful, becoming very rich.
Because he owned so many flocks, herds, and servants, the Philistines became jealous of him.
So the Philistines filled in all the wells that his father's servants had dug during his father Abraham's lifetime.
Finally, Abimelech said to Isaac, "Go away from us! You've become more powerful than we are."
So Isaac moved away. He set up his tents in the Gerar Valley and lived there.
He dug out the wells that had been dug during his father Abraham's lifetime. The Philistines had filled them in after Abraham's death. He gave them the same names that his father had given them.
Isaac's servants dug in the valley and found a spring-fed well.
The herders from Gerar quarreled with Isaac's herders, claiming, "This water is ours!" So Isaac named the well Esek [Argument], because they had argued with him.
Then they dug another well, and they quarreled over that one too. So Isaac named it Sitnah [Accusation].
He moved on from there and dug another well. They didn't quarrel over this one. So he named it Rehoboth [Roomy] and said, "Now the LORD has made room for us, and we will prosper in this land."
He went from there to Beersheba.
That night the LORD appeared to Isaac, and said, "I am the God of your father Abraham. Don't be afraid, because I am with you. I will bless you and increase the number of your descendants for my servant Abraham's sake."
So Isaac built an altar there and worshiped the LORD. He also pitched his tent in that place, and his servants dug a well there.
Abimelech, his friend Ahuzzath, and Phicol, the commander of his army, came from Gerar to see Isaac.
Isaac asked them, "Why have you come to me, since you hate me and sent me away from you?"
They answered, "We have seen that the LORD is with you. So we thought, 'There should be a solemn agreement between us.' We'd like to make an agreement with you
that you will not harm us, since we have not touched you. We have done only good to you and let you go in peace. Now you are blessed by the LORD."
Isaac prepared a special dinner for them, and they ate and drank.
Early the next morning they exchanged oaths. Then Isaac sent them on their way, and they left peacefully.
That same day Isaac's servants came and told him about a well they had dug. They said to him, "We've found water."
So he named it Shibah [Oath]. That is why the name of the city is still Beersheba today.
When Esau was 40 years old, he married Judith, daughter of Beeri the Hittite. He also married Basemath, daughter of Elon the Hittite.
These women brought Isaac and Rebekah a lot of grief.