It is prohibited to recite matters of sanctity in front of ervah (nakedness), as it says (Deuteronomy 23:15), “Your camp must be holy. Let Him not see any ervah among you and turn away from you.” Regarding a man who sees another man, or a woman who sees another woman, it is prohibited to recite matters of sanctity only in front of the specific organs of ervah itself (the private organs). However, concerning a man who sees a woman, the Chachamim teach (Berachot 24b), “A tefach of a woman is considered ervah.” What they meant is that it is forbidden to reveal any part of a woman’s body which is normally covered, and that if a part is exposed, one is prohibited from reciting matters of sanctity in front of it. (The specifications of this law are explained in Shulchan Aruch, Orach Chaim section 75 and in Penieni Halachah, Likutim Mishpachah 6:3-6).
Although we must educate girls to dress modestly starting from a young age, the prohibition against reciting matters of sanctity in front of a tefach that is normally covered begins from the time the girl starts to mature.
Likewise, regarding the hair on one’s head, the Chachamim teach (Berachot 24a), “A woman’s hair is ervah.” This refers to a married woman, for if her hair is not covered, one may not recite matters of sanctity before her. (The specifications concerning the laws of hair covering are clarified in Peninei Halachah, Likutim Mishpachah 6:14-15.)
Regarding one who must pray, recite berachot, or learn Torah, and there is a woman facing him who is revealing a tefach of areas that are normally covered, l’chatchilah, he should turn away so that he cannot see her. If he cannot turn away, he must look into his siddur, or close his eyes, and only then say the matters of sanctity (Shulchan Aruch 75:6; Mishnah Berurah, paragraphs 1 and 29).
Concerning hair covering, some Acharonim write that since, unfortunately, many married woman do not cover their hair, uncovered hair does not arouse impure thoughts, and b’dieved one may recite matters of sanctity in front of it. This only pertains to hair, regarding which the rule is more lenient than other normally covered parts, as single women are not obligated to cover their hair. However, concerning the normally covered parts of the body, as we have learned, one may not be lenient. Only in extenuating circumstances may one close his eyes or look in a siddur without looking at the exposed part (Aruch HaShulchan 75:7; Ben Ish Chai, Bo 12; Igrot Moshe, part 1, 44; see Peninei Halachah, Likutim Mishpachah 6:16).
Similarly, one may not recite matters of sanctity near a woman who is singing (Shulchan Aruch 75:3). However, according to some Acharonim, b’dieved, hearing a female singer on the radio does not prohibit reciting matters of sanctity (see Peninei Halachah ibid., 6:11).