I want to give an extended answer as I found the pre-existing here or elsewhere in need of a bit more clarification, specifically for newcomers.
Formula
In order to calculate the approximated total bitcoin earnings value per month from a mining operation (not taking into consideration mining costs [electricity, hardware maintenance etc...]) the following formula can be used:
H = Hashrate (hashes / second)
D = Difficulty (Reference for values below)
B = Reward per Block (Reference for value below)
N = Number of days per month (default = 30)
S = Number of seconds per day (S = 60 * 60 * 24 = 86400)

Example
H = 21,990,232,555,520 h/s (~= 20TH/s)
D = 47,427,554,950.648
B = 25
N = 30
S = 86400

The total number of bitcoins earned per month as per the defined variables above will be ~6.995. Dismiss N from the numerator and you'll get the daily value.
Python
A quick python statement as an example implementation (you can type this directly in the terminal)
$ python -c "print (30*21990232555520*25*86400)/(47427554950.648*2**32)"
$ 6.99542703277
Some References:
Difficulty (Current Value | Wiki)
Reward per Block (Current and Future values)
possible duplicate of How much Bitcoin will I mine right now with hardware X?
– Murch – 2013-12-12T21:32:59.567Check out this answer: http://bitcoin.stackexchange.com/a/135/5406
– Murch – 2013-12-12T21:33:10.753where I can fine the current block reward ? – user1761818 – 2013-12-12T22:04:17.840
Current Block Reward is 25BTC, it will be 12.5BTC starting with after Block 420,000. Check out BitcoinClock
– Murch – 2013-12-12T22:23:23.627