Inappropriate Staring at the Opposite Gender
The basis for the prohibition of staring at the opposite gender inappropriately is the pasuk "ולא תתורו אחרי לבבכם ואחרי עיניכם אשר אתם זונים אחריהם," "One should not be strayed after one's heart or eyes which one strays after" Chazal understand it to mean that one's eyes shouldn't gaze at inappropriately dressed women because it leads to sin. Alternatively, looking at inappropriately dressed women is forbidden because of Chazal's understanding of the pasuk "נִשְׁמַרְתָּ מִכֹּל דָּבָר רָע".
Staring at a Woman
- It is forbidden to stare at any part of a woman's body, even her pinky, if one intends to derive pleasure from looking at it. This is a particularly serious sin.
- It is permitted to stare at one's wife even when she's a Niddah even if it brings one's pleasure (nonetheless, it in some contexts it is still totally inappropriate). Nonetheless one may not look at certain parts of one's wife.
- For purposes of marriage, it is permitted and proper to look at one's intended wife before marrying her. 
- Aside for staring, there is a general prohibition to have inappropriate thoughts (Hirhurim) about the opposite gender.
- Seeing inappropriately dressed women is completely forbidden but it isn't one of the 3 prohibitions for which a person must give up their life, therefore, it is permitted to go an area where there are woman inappropriately dressed to save one's life or save someone else's life.
Avoiding a Place with Immodest Women
- It is permitted to go to work or another need even if on the way there are woman on the street that aren't dressed appropriately if there aren't other available paths. However, if other paths are available or one is only traveling for pleasure or vacation even if there are no other paths it is forbidden.
- Certainly this leniency applies to someone who knows that he won't come to inappropriate thoughts (hirhur) because of his seeing inappropriately dressed woman on his way to work, but can also apply to someone who thinks that it is likely that he won't come to such thoughts. However, someone who thinks that he will certainly come to inappropriate thoughts there it isn't clear that it is permitted.
Following Women in the Street
- Even though today it isn't possible for a man not to walk behind a woman at all when walking in the street, still a person should be careful what he looks at when walking.
- Bamidbar 15:39
- Sifrei Bamidbar 115, Nedarim 20a. Bet Shmuel EH 21:2 citing the Rabbenu Yonah writes that the prohibition to look at inappropriately dressed women is Biblically derived from this pasuk of achrei ayneychem.
- Devarim 23:10
- Ketubot 46a, Rambam (Isurei Biyah 21:21), Igrot Moshe EH 1:56
- Maharshal (Ketubot 2:3) writes that just looking is permitted even for a talmid chacham but not to look intently or stare.
- Brachot 24a, Rambam (Isurei Biyah 21:2), Shulchan Aruch EH 21:1. The Bet Shmuel 21:2 writes that it is Biblically forbidden according to the Rabbenu Yonah (Igeret HaTeshuva 19, cited by Bet Yosef 21:2) and rabbinically forbidden according to the Rambam. Either way, having inappropriate thoughts (Hirhur) about such a woman is Biblically forbidden.
- Yoma 74b
- Rambam Issurei Biyah 21:4
- Nedarim 20a, Raavad (Issurei Biyah 21:4)
- Kiddushin 41a, Rambam Ishut 3:19, Shulchan Aruch EH 21:3. See Yaavetz (Shabbat 53b) who says that for a very modest person it is permitted to get married without seeing one's intended wife.
- Ketubot 46a, Shulchan Aruch EH 23:3
- Igrot Moshe EH 1:56 proves that the prohibition with staring at woman who are inappropriately dressed is v'nishmarta, in that it leads to hirhurim and bitul shichvat zera, but not because of lo tikravu l'galot ervah. Therefore, he writes that if to avoid a life threatening situation someone would have to see inappropriately dressed woman he should violate the prohibition and not give up his life since this prohibition isn't one of the big three for which we give up our life. He distinguishes between this and the Gemara Sanhedrin 74a and says that if he took an action and brought before him a woman inappropriately dressed before him in order to take pleasure that would be prohibited because of giluy arayot and it would prohibited even in order to save his life.
- Furthermore, he writes that if one's intent isn't to benefit from seeing an inappropriately dressed woman it is obvious that one shouldn't give up one's life. His proof is Sotah 21a that a man should save a woman who is drowning and not think he's being stringent to avoid inappropriate contact.
- The Gemara Bava Batra 57b establishes that it is permitted to go on a path even if there are immodestly dressed women if there is no other path. The gemara says that if there is another path it is forbidden to go on the path with the immodestly dressed women even if one closes one's eyes. Igrot Moshe EH 1:56 adds that if one doesn't have a need, such as for making a livelihood, to travel on a path then it is forbidden to do so since it is considered as though there is another path, meaning, that the other alternative is just not to go at all.
- Chashukei Chemed b”b 57b quotes a gadol hador who said that if there's another path but it is just longer than the first it it is considered as though there isn't another path. Nonetheless, he would only rely upon this not frequently but not if there is an ongoing circumstance. Therefore, he writes that if one bank has tellers who aren't dressed appropriately and another bank has tellers who are dressed appropriately one should use the bank that has tellers who are dressed appropriately even if it involves a longer travel.
- Gemara Bava Batra 57b
- Igrot Moshe 1:56 writes that it is forbidden for a man to go to the beach because woman are inappropriately dressed there. As a conclusion of the gemara Bava Batra 57b, if he is sick and the doctor recommends for his health to go to the beach to get better it is still forbidden to go there if it is possible to find another beach where women aren't there or a time when women aren't there.
- Igrot Moshe EH 1:56. He explains that the leniency to go on a path where there are immodestly dressed women if there's no other option even though it is a negative commandment not to have hirhurim is because either it isn't certain that from seeing the immodest women one will have hirhurim or because hirhurim are only really prohibited in that they lead to bitul zera, which isn't automatic. (See also Chut Shani EH 21:1 p. 36-7, cited by ) Therefore, even though all hirhurim are forbidden and looking an inappropriately dressed woman is completely forbidden, when there is a need it is permitted to rely on the effort one will make not to look and not have a hirhur. He concludes that for someone who thinks that it is likely that he can not have hirhurim it is permitted for him to travel on that path if there's a need and there's no other path.
- The Chafetz Chaim (Lashon Hara 6:14, cited by Chashukei Chemed b”b 57b) asks why it is forbidden to take the path with the immodestly dressed woman if there's another path since one didn't intend to benefit from the inappropriate images based on the principle of dvar sheino mitchaven (see Pesachim 25b). He answers that hirhurim are more serious than other prohibitions.
- The Gemara Brachot 61a states that it is better to walk behind a lion than a women in the marketplace. Rav Shlomo Zalman Auerbach in Minchat Shlomo 1:91 writes that today since there are as many women as there are men on the street unlike in the days of chazal it is impossible not to follow a woman in the street. He concludes that for a mitzvah or for etiquette one can be lenient to follow a woman in the street. Rabbi Willig (approx min 30) added that even though it is impossible not to walk behind women but still you need to be careful of what you see. Rav Nissim Karelitz in Chut Shani (Shabbat v. 3 p. 268) writes that nowadays when it is impossible not to walk behind a woman in the streets one should walk quickly so as not to follow a particular woman.