Surprisingly, given its near-boundless breadth and the ancient rabbis’ interest in astral phenomena, the Talmud contains only a single discussion of solar eclipses, found in Tractate Sukkah. Gil Student summarizes the passage and explains how medieval and modern rabbis addressed the problems it raises:
The first [opinion cited in the Talmud] is that solar eclipses are a bad omen for the whole world. Another opinion is that they are a bad omen for Gentiles while lunar eclipses are a bad omen for Jews—[apparently] because the Jewish calendar is lunar while the Gentile calendar is solar. Additionally, the Talmud states says that four things cause solar eclipses: 1) a deceased chief judge who is eulogized insufficiently, 2) a betrothed woman who is assaulted and not rescued, 3) homosexual relations, and 4) twin brothers killed at the same time.
Rabbi Moses Isserles (1520-1572) asks how the sages can attribute reasons to a solar eclipse, which is a natural occurrence. Whether or not people sin, the solar eclipse will happen. . . . He quotes [earlier sources that] interpret this passage allegorically. Rabbi Isaac ben Moses Arama (1420-1494) explains that the Talmud really refers to the death of the righteous, [when those who are a source of light suddenly go dark]. . . .
[Taking a different approach], Rabbi Judah Loew of Prague (d. 1609) explains that the Talmud is offering reasons why God established nature in such a way that there would be solar eclipses. If people did not sin, we would merit eternal light. However, because God knew people would sin, He created the world so that solar eclipses would happen. Thus the Talmud is not offering the reason for a solar eclipse (which is a natural phenomenon), but the reason behind the reason (why nature is the way it is). . . .
Rabbi Jonathan Eybeschütz (1690-1764), [who was quite aware of and impressed by the scientific discoveries of his day], suggests that the Talmud is referring not to eclipses but to sunspots. While solar eclipses can be predicted, sunspots cannot—because they are caused by sin.
More about: Astrology, Maharal, Religion & Holidays, Science and Religion, Talmud