One night, however, God came to Abimelech in a dream and told him, “You are as good as dead because of the woman you have taken, for she is a married woman.”
3. But God came to Abimelech in a dream by night . Here Moses shows that the Lord acted with such gentleness, that in punishing his servant, he yet, as a father, forgave him: just as he deals with us, so that, while chastising us with his rod, his mercy and his goodness far exceed his severity.
It appears by this that God revealed himself by dreams (which evidenced themselves to be divine and supernatural) not only to his servants the prophets, but even to those who were out of the pale of the church and covenant; but then, usually, it was with some regard to God's own people as in Pharaoh's dream, to Joseph, in Nebuchadnezzar's, to Daniel, and here, in...
Commenting on Genesis 20:3-7
But God came to Abimelech in a dream by night,.... Put a dream into his mind, by which he cautioned him against taking Sarah to be his wife; so careful was the Lord that no wrong should be done to such a godly and virtuous person, to which she was exposed through the weakness of her husband.