To clear up a few points: in Roman Catholicism, there is a prevailing belief that: without being baptized, a person cannot go to heaven. Or as some would put it: "there is no salvation outside the Church".

However, there is such a thing called a "baptism of desire." So that while a person is not formally baptized (because he/she belongs to another religion, is an fervent atheist/agnostic or whatever), he/she can be implicitly baptized, and thus a member of the Church.

How does one become implicitly baptized? By following the natural law as much as one can given one's limited understanding of it. What is the natural law? It can be summed up by the Ten Commandments or alternately the two principles of moral action: "Love God above all." and "Love your neighbors as yourself." Thus, if one follows the golden rule, one can attain heaven

Finally, the Catholic Church recognizes that the Holy Spirit is present in all religions of the world (with the possible exception of satanic and similar cults). However, only Christianity received the fullness of revelation (and thus considers all other religions flawed in one way or another).

Salvation by faith alone is a characteristic of the Protestant brand of Christianity. See also Martin Luther.

update: May 13, 2000 Let me just quote som relevant stuff from the Catechism (1992 edition):

"1260 'Since Christ died for all, and since all men are in fact called to one and the same destiny, which is divine, we must hold that the Holy Spirit offers to all the possibility of being made partakers, in a way known to God, of the Paschal mystery.' Every man who is ignorant of the Gospel of Christ and of his Church, but seeks the truth and does the will of God in accordance with his understanding of it, can be saved. It may be supposed that such persons would have desired Baptism explicitly if they had known its necessity."

Also, regarding the fate of unbaptized children: "1261 As regards children who have died without Baptism, the Church can only entrust them to the mercy of God, as she does in her funeral rites for them. Indeed, the great mercy of God who desires that all men should be saved, and Jesus' tenderness toward children which caused him to say: 'Let the children come to me, do not hinder them,'allow us to hope that there is a way of salvation for children who have died without Baptism."

Disclaimer: I am not a theologian: this is what I understood from religion classes. Corrections in matters of doctrine are welcome.