Formula for calculating daily mining earnings
Let X be hashes per second, and Y be the difficulty. Let Z be the Log base 1-1/(2^32*Y) of 1/2. Z is how many hashes it will take you to find a block, on average. Let A be the current block reward (it's currently 25). Let B be the number of seconds in a 24-hour day: 86,400. You will earn, on average, A*X*B/Z bitcoins per day.