From the first encyclical of Pope Francis:
“Because faith is a way, it also has to do with the lives of those men and women who, though not believers, nonetheless desire to believe and continue to seek. To the extent that they are sincerely open to love and set out with whatever light they can find, they are already, even without knowing it, on the path leading to faith. They strive to act as if God existed, at times because they realize how important he is for finding a sure compass for our life in common or because they experience a desire for light amid darkness, but also because in perceiving life’s grandeur and beauty they intuit that the presence of God would make it all the more beautiful. Saint Irenaeus of Lyons tells how Abraham, before hearing God’s voice, had already sought him ‘in the ardent desire of his heart’ and ‘went throughout the whole world, asking himself where God was to be found’, until ‘God had pity on him who, all alone, had sought him in silence’. Anyone who sets off on the path of doing good to others is already drawing near to God, is already sustained by his help, for it is characteristic of the divine light to brighten our eyes whenever we walk towards the fullness of love.” [Lumen Fidei 35]
Now we know that this encyclical was written mainly by Pope Benedict XVI, some of it before resigning and the rest after resigning. Then Pope Francis touched it up a bit and added a couple of paragraphs. In any case, it was issued by the reigning Pontiff, so it is a teaching of the Magisterium.
The text above concerns those men and women who are not believers. This would include atheists, who think that God does not exist, as well as agnostics, who doubt that God exists or who think that it doesn’t matter. Such persons can implicitly love God by loving their neighbor, and therefore, they can be said to “desire to believe” in that they are seeking love, justice, and truth, among other transcendent goods.
Technically, though, some other persons can be classified as non-believers. The adherents of certain pagan religions, whose many gods and goddesses have little about them that is truly good or perfect or divine, are not really believers. For they lack belief in a God of love and justice, and their religion does not teach love of neighbor, nor any fundamental moral principles. The ancient religions of the Greeks and Romans, as well as the folk religions of some regions of the world today as well as the Hindu religion would all fit this type of belief system. The path of salvation for such persons is much the same as for atheists and agnostics. For their religion does not offer much help to them on the path toward heaven, and often hinders them.
Despite lacking belief in a Creator God, who loves us and teaches us to love others, non-believers can be saved by the love of neighbor.
“Anyone who sets off on the path of doing good to others is already drawing near to God, is already sustained by his help, for it is characteristic of the divine light to brighten our eyes whenever we walk towards the fullness of love.”
Loving others selflessly can only be done by the help of God’s grace. This love is shown by good deeds, as recommended by Christ in Matthew 25. And grace always precedes, accompanies, and follows good works done out of selfless love. In this way, an unbaptized person, who loves others selflessly, receives a baptism of desire, and thereby enters the state of grace.
“An act of love is sufficient for the adult to obtain sanctifying grace and to supply the lack of baptism.” [Address to Midwives]
By loving one’s neighbor, a person can receive a baptism of desire and the state of grace, including the three theological virtues of love, faith, and hope. This baptism of desire forgives all past personal sins and wipes away original sin. But it does not remit all temporal punishment due for past sins, nor does it imprint the indelible character of Baptism on the soul, as does the full Sacrament of Baptism.
All who love others selflessly also love God, at least implicitly. Without any exception, all persons who are in the state of grace necessarily love others and love God. All persons who are not in the state of grace necessarily do not truly selflessly love anyone. All persons who love others are in the state of grace, and all persons who do not love others are not in the state of grace.
The state of grace is the state of loving God and neighbor. But since God can be loved implicitly, through the love of others, an atheist or other non-believer can love God and neighbor, and therefore they can be in the state of grace.
All persons who die in the state of grace will have eternal happiness in Heaven, perhaps after a time of purification in Purgatory. All persons who die without the state of grace will not have eternal happiness, but will be punished forever in Hell.
Please take a look at this list of my books and booklets, and see if any topic interests you.