A solar eclipse occurs when the moon comes in between the earth and the sun and when all the three bodies are aligned.