An excerpt from Lumen Gentium, 2 and 16.
God resolved to gather into holy Church all who believe in Christ. The Church, foreshadowed even from the beginning of the world, so marvelously prepared in the history of the people of Israel, established in these last times and revealed by the outpouring of the Holy Spirit, will be made perfect in glory at the end of time. Then, as we read in the Fathers of the Church, all the righteous from Adam onward—from Abel, the righteous, to the last of the elect—will be gathered in the universal Church in the presence of the Father.
Finally, those who have not yet received the Gospel are in their different ways related to God’s people.
In the first place, there is that people which was given the covenants and the promises and from which Christ was born by human descent: the people which is by God’s choice most dear on account of the patriarchs. God never repents of his gifts or his call.
God’s plan of salvation embraces those also who acknowledge the Creator. Among these are especially the Mohammedans; they profess their faith as the faith of Abraham, and with us they worship the one, merciful God who will judge men on the last day.
God himself is not far from those others who seek the unknown God in darkness and shadows, for it is he who gives to all men life and inspiration and all things, and who as Savior desires all men to be saved.
Eternal salvation is open to those who, through no fault of their own, do not know Christ and his Church but seek God with a sincere heart, and under the inspiration of grace try in their lives to do his will, made known to them by the dictates of their conscience. Nor does Divine Providence deny the aids necessary for salvation to those who, without blame on their part, have not yet reached an explicit belief in God, but strive to lead a good life, under the influence of God’s grace.
Whatever goodness and truth is found among them is seen by the Church as a preparation for the Gospel, and as given by him who shines on all men, so that they may at last have life.
These charisms, the simpler and more widespread as well as the most outstanding, should be accepted with a sense of gratitude and consolation, since in a very special way they answer and serve the needs of the Church.
and to the Son
and to the Holy Spirit:
as it was in the beginning,
is now, and will be forever. Amen