This concept that a person can reincarnate [into him] during his life is called by the Chachamim (Rabbis) as the "secret of the Ibbur." This is the difference between gilgul [reincarnation where one's soul(s) enter the body at birth] versus Ibur [the entering of the souls of a Tzaddik during one's lifetime]. Sometimes, it is possible that not only the Nefesh of a Tzaddik enters into him (via Ibur), but also that Tzaddik's Ruach as well.

This can even be the Ruchot of the Tzaddikim haRishonim, even the Avot (who have their souls in Gan Eden). This can even happen in our lifetime. All of this is dependent on the level of mitzvot that this person does. For example, there are mitzvot that have the segula (power) to bring down a "Nefesh" of a certain Tzaddik [in the form of an Ibur], and there are mitzvot that can bring down the "Ruach" of a tzaddik, as we explained.