Let me add to what Tom has just posted since Rob often makes certain claims about Bell's theorem which are simply wrong. So in this post I am going to *defend* Bell.
To this end, let me first point out that Bell is one of my heroes. My disagreement with his theorem does not change this fact by a whisker.
Next, it is important to note that Bell assumes almost nothing, apart from the factorizability of classical probabilities in the equation Tom has just quoted. No spin, no coins, no gloves, no photons. He assumes nothing.
What he does assume is that there are common causes, say L, which dictate the measurement results, say A and B, occurring at local measuring devices parameterized by, say, a and b. Next he very reasonably assumes the factorizability of the joint measurement result AB as follows:
AB(a, b, L) = A(a, L) x B(b, L).
Expressed this way, it is evident that the results A and B are manifestly local. They depend only on their respective local parameters a and b, and the common causes L (which can be taken as the shared randomness between Alice and Bob).
This is it. Bell assumes nothing else. He then claims that it is mathematically impossible for correlations between the local functions A(a, L) and B(b, L) to exceed the linear correlation. In particular, he claims that they cannot reproduce the strong sinusoidal correlation predicted by quantum mechanics and observed in Aspect-type experiments.
It is only in this last point that I disagree with Bell. For it is in fact trivial to reproduce the strong correlation in this manner, as can be seen from the attached two pages.Attachment #1: EPRB.pdf