There's two sides to this debate:
Big boom theory, where all the gases and space matter formed the earth, or the religious side, where god built the earth in seven days. I personally side with the religious side.
Actually, that's just the Christian theory on it. I believe that the Big Bang could've happened, but I think it was God Himself who caused it.
I mean seriously, what says that Science has to be contradicting to religion and vice versa?
Because I have never heard of a religion, thank thinks god caused the Big Bang to make earth.