Pesachim Chapter 8, Mishnah 5. This mishnah deals with various types of tumah in which a person finds himself on the final day of his impurity, and that evening he will become pure. In such a case one may slaughter the Pesach offering on his behalf, since he will be able to eat it that night when he is pure.
A zav who experienced two emissions:
A zav is someone who has had an irregular emission. One who experiences such an emission twice becomes a zav, who requires seven clean days in order to become pure. On the seventh day he immerses in a mikvah, and that night he is pure. Therefore the mishnah teaches: "Zav sheraah shtei re'iyos - shochtin alav bishvi'i shelo" - one may slaughter the Pesach offering on his behalf on the seventh clean day following his emissions, since that night he will be pure and will be able to eat the Pesach offering.
The Gemara teaches, however, that one may slaughter on his behalf only after he has already immersed, for at that stage all he still lacks is nightfall. The concern is that if they were to slaughter on his behalf before his immersion, he might be negligent and fail to go down to the mikvah.
A zav who experienced three emissions:
One who experiences a third emission is also obligated to bring an offering on the eighth day. Once he has immersed on the seventh day he is pure that night to a certain degree, but his purity is not complete: he is called mechusar kipurim, since he has not yet brought his offerings. Regarding him the mishnah says: "Shochtin alav bishmini shelo" - on the eighth day, which is the day on which he brings his offering, and even though he has not yet actually brought it. The Gemara adds that one may slaughter on his behalf only if he has handed his offering over to the court, so that we know he will not be negligent about bringing it.
The commentators discuss how it is possible to bring the offering he is obligated in after the Pesach offering, since the Pesach offering is brought after the afternoon tamid, while other types of offerings are not brought after the afternoon tamid. The resolution of this question is discussed in the words of the commentators.
Shomeres yom keneged yom:
From here the mishnah moves on to another type of tumah: a woman who sees blood outside her usual time. In her halachic cycle there are seven days of niddah followed by eleven days of zivah. A woman who sees blood during the eleven days of zivah for one day or two days is called a shomeres yom keneged yom: she must observe one clean day following her sighting, and on that day she immerses in a mikvah, and if she saw nothing on it, she is pure that night.
Therefore the mishnah teaches: "Shomeres yom keneged yom - shochtin aleha basheni shelah" - one may slaughter the Pesach offering on her behalf the next day, on the day she observes as a clean day, on which she immerses, and after her immersion she will be pure that night and will be able to eat the Pesach offering. If she saw for two days - "shochtin aleha bashlishi", on the third day, which is her only clean day.
A zavah gedolah:
"Vehazavah - shochtin aleha bashmini" - this zavah is a zavah gedolah, who saw blood for three consecutive days, and therefore requires seven clean days and also the bringing of an offering. On the seventh clean day she goes down to the mikvah, and that night she is pure to a certain degree and may eat Terumah, but she does not eat sacrificial food - and the Pesach offering is included in sacrificial food - until after she brings her offerings on the eighth day. And just as was said regarding the zav, if she handed her offerings over to the court, even though she has not yet actually brought them, one may slaughter the Pesach offering on her behalf so that she will be able to eat it that night.
In summary: in this mishnah we learned four cases in which the Pesach offering is slaughtered on behalf of someone who is not yet completely pure, because he will be pure at night: a zav who experienced two emissions - on his seventh day, after immersion; a zav who experienced three emissions - on his eighth day, after he handed his offering over to the court; a shomeres yom keneged yom - on her clean day of observation, on the second or the third day; and a zavah gedolah - on her eighth day, after she handed her offerings over to the court.