Which sentence is more formal?
A. A solar eclipse occurs when the moon goes in front of the sun and leaves a shadow on the earth.
B. A solar eclipse occurs when the moon passes in front of the sun, casting a shadow on the earth.
Select the correct answer from the provided options and reply with the letter associated with it.
Answer: B