Makkos, Chapter 3, Mishnah 14. This mishnah deals with the verses read out during the lashes: while the person being flogged receives his blows, one of the members of the court reads aloud verses that speak of the punishment that comes upon one who does not heed the words of the Torah.
The verses read during the lashes:
"V'korei hakorei" - the one appointed to read reads the verses: "Im lo sishmor la'asos" etc. - if you will not be careful to keep and to perform the words of the Torah, "l'yirah es Hashem" etc., "v'hifla Hashem es makoscha v'es makos" etc. - that Hashem will make extraordinary your blows and the blows of your offspring. And when the verses are finished - "v'chozer lis'chilas hamikra", he returns to the beginning and reads them again, and so on until the lashes are completed.
Another version adds a verse: "Ushmartem es divrei habris hazos" etc. - that you must keep the words of this covenant, "v'chosem" - and he concludes with "V'hu rachum yechaper avon" etc., the verse that we say from Tehillim. And according to this version, at this point "v'chozer lis'chilas hamikra" - he goes back to the top and reads all of these verses from their beginning.
If he died at the hand of the one administering the lashes:
"V'im mes tachas yado - patur" - if the one being flogged died at the hand of the one administering the lashes, that person is exempt, since he was performing a mitzvah at the instruction of the court and as their agent.
"Hosif lo od retzuah achas u'mes - harei zeh goleh al yado" - if he added one blow beyond what was determined, and because of it the one being flogged died, he is exiled, like the law of one who kills a person unintentionally.
If he was soiled in the middle of the lashes:
Sometimes such a great humiliation occurs in the middle of the lashes that it is considered as though the person being flogged has already received the remaining blows: "Nitkalkel bein b'ri'i bein b'mayim - patur" - if he soiled himself, whether with excrement or with urine, he is exempt from that point on from the rest of the blows. The reason is that the verse says "v'nikleh achicha l'einecha", and the Gemara learns from this that he must become light in your eyes - and since he has already been disgraced and shamed by losing control of his bodily needs, he has already become light.
Rabbi Yehudah qualifies this: "Ha'ish b'ri'i, v'ha'ishah bishneihem" - a man suffers significant humiliation only through excrement, while urinating does not disgrace him to a significant degree; but a woman, who is embarrassed more easily, is disgraced even if she is caused to urinate in the middle, and therefore she is exempt through both.