Chris Wiggins, an associate professor of applied mathematics at Columbia University, offers this explanation.
A patient goes to see a doctor. The doctor performs a test with 99 percent reliability--that is, 99 percent of people who are sick test positive and 99 percent of the healthy people test negative. The doctor knows that only 1 percent of the people in the country are sick. Now the question is: if the patient tests positive, what are the chances the patient is sick?
The intuitive answer is 99 percent, but the correct answer is 50 percent, and Bayes's theorem gives us the relationship between what we know and what we want to know in this problem. What we are given--what we know--is p(+|s), which a mathematician would read as "the probability of testing positive given that you are sick"; what we want to know is p(s|+), or "the probability of being sick given that you tested positive." The theorem itself reads p(s|+)=p(+|s)p(s)/p(+), although what Reverend Bayes, who lived from 1702 to 1761, actually said was something simpler. Bayes stated the defining relationship expressing the probability you test positive AND are sick as the product of the likelihood that you test positive GIVEN that you are sick and the "prior" probability that you are sick (that is, the probability the patient is sick, prior to specifying a particular patient and administering the test).
Rather than relying on Bayes's math to help us with this, let us consider another illustration. Imagine that the above story takes place in a small country, with 10,000 people. From the prior p(s)=0.01, we know that 1 percent, or 100 people, are sick, and 9,900 are healthy. If we administer the test to everyone, the most probable result is that 99 of the 100 sick people test positive. Since the test has a 1 percent error rate, however, it is also probable that 99 of the healthy people test positive. Now if the doctor sends everyone who tests positive to the national hospital, there will be an equal number of healthy and sick patients. If you meet one, even though you are armed with the information that the patient tested positive, there is only a 50 percent chance this person is sick.
Now imagine the doctor moves to another country, performing the same test, with the same likelihood (p(+|s)) and, for that matter, the same success rate for healthy people, which we might call p(-|h), "the probability of scoring negative given that one is healthy." In this country, however, we suppose that only one in every 200 people is sick. If a new patient tests positive, it is actually more probable that the patient is healthy than sick. The doctor needs to update the prior. (The correct probability is left as a homework assignment for the reader.)
The importance of accurate data in quantitative modeling is central to the subject raised in the question: using Bayes's theorem to calculate the probability of the existence of God. Scientific discussion of religion is a popular topic at present, with three new books arguing against theism and one, University of Oxford professor Richard Dawkins's book The God Delusion, arguing specifically against the use of Bayes's theorem for assigning a probability to God's existence. (A Google news search for "Dawkins" turns up 1,890 news items at the time of this writing.) Arguments employing Bayes's theorem calculate the probability of God given our experiences in the world (the existence of evil, religious experiences, etc.) and assign numbers to the likelihood of these facts given existence or nonexistence of God, as well as to the prior belief of God's existence--the probability we would assign to the existence of God if we had no data from our experiences. Dawkins's argument is not with the veracity of Bayes's theorem itself, whose proof is direct and unassailable, but rather with the lack of data to put into this formula by those employing it to argue for the existence of God. The equation is perfectly accurate, but the numbers inserted are, to quote Dawkins, "not measured quantities but & personal judgments, turned into numbers for the sake of the exercise."