In Parshat Lech-Lecha, we read about the incident where Avram and Sarai are driven from Cana'an because of a famine and go to live in Egypt. In order to protect Avram's life, they declare themselves as brother and sister.There are are several different questions being asked that need to be dealt with.
Several of the commentators, especially the Ramban, state that Avram erred in this matter because he left Cana'an without G-d's command, and thereby risked Sarai's life and honor. (The Ramban also sees the Egyptian exile of Avraham's descendents as a punishment for this sin.)
But what about the additional sin of putting Sarai (a married women) in a position where she might have martyred herself and not submit to gilui arayot (a severe illicit relationship). Here, we can probably say that before receiving the Torah, the rule that requires martyrdom instead of gilui arayot does not apply.
Now we move to Parshat Vayera, and this time we read of a more puzzling incident where Avraham and Sara go to live in Grar, and again adopt the "brother and sister" story. But this time, there was no famine that drove them away from Eilonai-Mamrei! (Rashi says that one of the reasons for the move was to distant themselves from Lot, who became infamous because of his relationships with his daughters.) Of course, Sara was taken to King Avimelech's house. Sara was ultimately saved from being violated only because of G-d's intervention.
Since there was no famine in Cana'an, what was Avraham's justification for moving to Grar, and then using the "brother and sister" story again? (This was against Sara's will, according to Rashi.) The dangers were very real and no justification is stated in the Torah. In fact, during G-d's dealings with Avimelech, Avimelech is shown to be a tzadik and Avraham is not shown in that light.
Later, during the confrontation between Avraham and Avimelech, Avraham excuses his behavior by saying "I thought there was no fear of G-d in this place, and I expected to be killed because of my wife". So why did he come to Grar?
So how do we explain Avraham's behavior in this incident?
Even those who fault Avraham for going to Mitzrayim, do not fault him for going to Grar. Yitzchak was forbidden to leave Eretz Canaan as a result of the Akeidah, but Hashem told him (in Toldos) specifically to stay in Grar. Thus, Grar was not outside of Canaan and there was nothing wrong with that. The only problem was the trick that Avrohom used. As Avraham tells Avimelech, this trick was actually necessary and part of their normal behavior. It is only brought up in the Torah when the king (who was the only one who could get away with violating Avraham's rights as the "brother" of an unmarried woman) actually took the "sister" in order to make her part of her harem.
Rav S. R. Hirsch (among others) points out that this trick was designed to save the two of them from the general population of the city state. As Rav Hirsch says,(as translated in the Judaica Press edition) in Vayera chapter 20 pasuk 2.
"... unmarried virgins must have been much safer amongst the people than married women. It seems to have been only princes that unmarried strangers had reason to fear. And actually it was again only a king that dared to take her, and who later on has no scruples in admitting it."Avimelech, in fact, is wrong even though he *thinks* that he is innocent. When Hashem "speaks" to him, Avimelech says
בתם לבבי ובנקיון כפי עשיתי
in the innocence of my heart and the integrity of my hands I did thisHowever, when Hashem responds, he says
גם אני ידעתי כי בתם לבבך עשית זאת
I know that you thought that you were acting innocently (my translation)We see that Hashem acknowledges that Avimelech thought that he was right, but tells him that not only was he wrong, but he needs to get Avrohom to pray for him or he would die as a result of what he did
ויתפלל בעדך וחיה And he will pray for you and you will liveThus we see that Avimelech was deserving of death for the abuse of power. Note that Avimelech does not dispute the fact that Avrohom used the trick on everyone else. He is just upset that Avrohom did not let him know what was going on. Indeed, Avimelech in Toldos tells Yitzchak
כמעט שכב אחד העם את אשתך
One of the people might have "taken" your wife (in "nicer" language)Rashi points out that this means he himself might have taken her. In fact, Avimelech there has to explicitly warn the people not to "touch" either Yitzchak or Rivkah, even though Eisav was already grown (and according to some meforshim) running the family "defense forces". Avimelech in Vayera did not dare let Avraham stay in the city itself. He couched his "request" that Avraham leave in nicer language by telling him that he was free to settle wherever in the land under his (Avimelech's) control that he wanted to.