This is one of the stories in the book The Pig That Wants To Be Eaten. It is particularly interesting as it is about logical thinking on the usually illogical religious belief.
God was having a conversation with the philosopher who thought that the fact of no evidence on the non-existence of god was not an evidence on the existence of god.
God said to the philosopher, I give you a reason to believe: a gamble based on self-interest.
There are two possibilities: I exist or I do not exist.
If you believe in me and I exist, you get eternal happiness in heaven.
If you believe in me but I do not exist, you get a normal short mortal life.
If you do not believe in me and I do not exist, you still get a mortal life.
If you do not believe in me and I exist, you will suffer from the eternal fire.
It is easy to see that if you gamble that I do not exist, the best you can get is mortal life, but the worst scenario is eternal damnation.
If you gamble that I exist, the worst you can get is the mortal life, but the best outcome is eternal happiness.
So any person with a logical mind should believe that god exists; he could win a chance to heaven and not losing anything he already has, but could certainly avoid the worst of hell.
This theory was proposed by Blaise Pascal in 1660 with a view to defending Christian faith by reason.
The critics agreed that believing in god would be a good bet if there were only two such possibilities. However, there are much more than just choosing to believe in god, which god in particular. If there were such an envious and unforgiving god, believing in the wrong one would have serious consequences. Christians in particular consider that people not accepting Jesus as the messiah would surely go to hell, that would include many good Muslims, Jews, Buddhists and many other faithful religious people. Some would believe in a benevolent and all-loving god that eternal salvation would be granted if you just committed a mistake in believing the wrong god but would remain moral (which is a vaguely defined term in different times, cultures and religions). However, for such a good god, he would similarly grant eternal happiness to the non-believers who would be equally if not more moral.
As far as gambling based on self-interest is concerned, the bet should be placed on the belief of one vengeful and punishing god who commands absolute belief in him, or the belief that there is no god or god is forgiving in whatever you believe as long as you are moral. Even if you bet on a nasty god, there are too many to choose from. Betting is not a rewarding game afterall.