The tradition of making a Spiritual Communion can be traced at least to St. Thomas Aquinas who defined it as “an ardent desire to receive Jesus in the Holy Sacrament and a loving embrace as though we had already received him.”
In 1983 the Congregation for the Doctrine of the Faith declared that the effects of Holy Communion can be received through spiritual communion for persons in the following situations:
• Those at priest-less parishes;
• Those who are prevented from attending Eucharistic celebrations;
• The divorced and remarried;
• Those at the Protestant Lord’s Supper.

Examples of Prayers for a Spiritual Communion
St. Alphonsus Liguori
My Jesus, I believe that Thou art present in the Blessed Sacrament. I love Thee above all things and I desire Thee in my soul. Since I cannot now receive Thee sacramentally, come at least spiritually into my heart. As though wert already there, I embrace Thee and unite myself wholly to Thee; permit not that I should ever be separated from Thee. Amen.

Cardinal Rafael Merry del Val:
At Thy feet, O my Jesus, I prostrate myself and I offer Thee repentance of my contrite heart, which is humbled in its nothingness and in Thy holy presence. I adore Thee in the Sacrament of Thy love, the ineffable Eucharist. I desire to receive Thee into the poor dwelling that my heart offers Thee. While waiting for the happiness of sacramental communion, I wish to possess Thee in spirit. Come to me, O my Jesus, since I, for my part, am coming to Thee! May Thy love embrace my whole being in life and in death. I believe in Thee, I hope in Thee, I love Thee. Amen.

Anonymous:
As I cannot this day enjoy the happiness of assisting at the holy Mysteries, O my God! I transport myself in spirit at the foot of Thine altar; I unite with the Church, which by the hands of the priest, offers Thee Thine adorable Son in the Holy Sacrifice; I offer myself with Him, by Him, and in His Name. I adore, I praise, and thank Thee, imploring Thy mercy, invoking Thine assistance, and presenting Thee the homage I owe Thee as my Creator, the love due to Thee as my Savior. Apply to my soul, I beseech Thee, O merciful Jesus, Thine infinite merits; apply them also to those for whom I particularly wish to pray. I desire to communicate spiritually, that Thy Blood may purify, Thy Flesh strengthen, and Thy Spirit sanctify me. May I never forget that Thou, my divine Redeemer, hast died for me; may I die to all that is not Thee, that hereafter I may live eternally with Thee. Amen.

St. Josemaria Escriva:
I wish, Lord, to receive you with the purity, humility and devotion with which your most holy Mother received you, with the spirit and fervour of the saints.