Zohar: Purity and Evil
Observe that he who gives way to the temper and suffers himself to be led and guided by it, defiles not only himself but also those with whom he comes into personal contact. As already stated, though the wickedness of the antediluvians was great and their evil deeds were many, yet was the Holy One unwilling to destroy them, but long-suffering towards them, notwithstanding, and their shameful propensities and heinous practices, of which it is written 'that they were only evil continually.' Their evil actions are denoted by the word Ra (pollution). Of Er, the eldest son of Judah, who was guilty of this sin; it is written that 'he was wicked in the sight of the Lord and the Lord slew him.'" (Gen. xxxviii., 7.)
Said Rabbi Jose: "Is not this sin synonymous with what is termed rashang (wickedness or wrongdoing)?"
"No," replied Rabbi Jehuda, "for rashang is applied to intentional evil ere it becomes an actuality, but Ra refers to him who defiles himself by the dissipation of his vital powers and thus gives himself up to the unclean spirit called Ra. He who thus renders himself impure will never attain unto the Divine Life nor behold the face of the Shekina, whose disappearance from the world previous to the deluge was owing to the vice termed Ra. Woe unto him who indulges in it, for he will never experience the joy of living in the presence of the Holy One, but will drag on through life as a degraded captive and miserable slave of Ra, the unclean spirit; so true are the words, 'The fear of the Lord leadeth to life, it bringeth peaceful nights free from visits of the impure spirit Ra' (Prov. xix., 23). And therefore it is written, 'Evil (Ra) shall not dwell with thee' (Ps. v., 4). Only the pure in life and thought and deed can say, 'Yea though I walk through the valley of the shadow of death, I will not be afraid of Ra, for thou art with me and causest me to dwell in the house of the Lord forever.'" (Ps. xxiii., 4-6.)
This scripture is discussed in the lecture Daath: The Doorway to Knowledge