"For those too who through no fault of their own do not know Christ and are not recognized as Christians, the divine plan has provided a way of salvation. As we read in the Council's Decree Ad Gentes, we believe that "God in ways known to himself can lead those inculpably ignorant of the Gospel" to the faith necessary for salvation (AG 7). Certainly, the condition "inculpably ignorant" cannot be verified nor weighed by human evaluation, but must be left to the divine judgment alone. For this reason, the Council states in the Constitution Gaudium et Spes that in the heart of every man of good will, "Grace works in an unseen way.... The Holy Spirit in a manner known only to God offers to every man the possibility of being associated with this paschal mystery" (GS 22)...
...This affirmation of the Savior's "uniqueness" derives from the Lord's own words. He stated that he came "to give his own life in ransom for the many" (Mk 10:45), that is, for humanity, as St. Paul explains when he writes: "One died for all" (2 Cor 5:14; cf. Rom 5:18). Christ won universal salvation with the gift of his own life. No other mediator has been established by God as Savior. The unique value of the sacrifice of the cross must always be acknowledged in the destiny of every man.
...For those, however, who have not received the Gospel proclamation, as I wrote in the Encyclical Redemptoris Missio, salvation is accessible in mysterious ways, inasmuch as divine grace is granted to them by virtue of Christ's redeeming sacrifice, without external membership in the Church, but nonetheless always in relation to her (cf. RM 10). It is a mysterious relationship. It is mysterious for those who receive the grace, because they do not know the Church and sometimes even outwardly reject her. It is also mysterious in itself, because it is linked to the saving mystery of grace, which includes an essential reference to the Church the Savior founded.
..Religions can exercise a positive influence on the destiny of those who belong to them and follow their guidance in a sincere spirit. However, if decisive action for salvation is the work of the Holy Spirit, we must keep in mind that man receives his salvation only from Christ through the Holy Spirit. Salvation already begins during earthly life. This grace, when accepted and responded to, brings forth fruit in the gospel sense for earth and for heaven.
...What has been said, however, should not lead to the conclusion that her missionary activity is less needed in these situations--quite the contrary. In fact, whoever does not know Christ, even through no fault of his own, is in a state of darkness and spiritual hunger, often with negative repercussions at the cultural and moral level. The Church's missionary work can provide him with the resources for the full development of Christ's saving grace, by offering full and conscious adherence to the message of faith and active participation in Church life through the sacraments."
-John Paul II, General Audience