I found the following excerpt from this page:
Let X be the random variable we are interested in generating, and let F(x) be its distribution function, ie
$F(x) = Pr\{X ≤ x\}$
There is a theorem which says that, if F(x) is continuous, then F(X) is uniformly distributed on the interval (0,1). This can be used to generate random variables with specified distributions.
What's the name of this theorem or can someone show me a reference?