It’s a bit more complex than that, but this is the basic idea.
The idea really took off when the great German scholar F. Max Müller (1823-1900) associated solar mythology with the “pure” religion of the Aryan peoples. For him, all mythology originated in attempts to explain natural phenomena; therefore, the ur-religion of Aryan humanity must have been pristine solar worship (as opposed to non-Aryan peoples, who worshiped snakes and the earth and what have you). He recognized that the descendants of the Aryan people (whom we today call Proto-Indo-Europeans out of deference to sensibilities) all had deities whose names were cognate—Jupiter, Zeus Pater, Dyaus Pita, etc.—all meaning the god of the shining sky, called “Father.” From this he concluded that this god was the sun and that with the title Father he was therefore the chief god. (Today we believe that *dyeus derives from “bright,” not “shining,” and refers to the sky as a whole, not the sun.)
Müller argued that the Aryans had a pure religion of nature worship, but later peoples, through “disease of language,” came to see the metaphors used to describe nature as independent divinities (such as Aurora, the dawn goddess) and later as heroes. Thus, Indo-European mythology, is merely a long process of corruption as the sun became divided into many gods, and these gods degenerated into heroes. The metaphors used to describe the sun’s annual passage across the sky decayed into stories of the hero’s journey. Later, other scholars would expand the solar theory beyond the Aryans to others, including the Semitic peoples on the Near East.
This is not to blame Müller; he was a great scholar, and the theory he proposed (though wrong) was carefully limited and designed around a close analysis of comparative language usage. His followers, instead, simply made everything the sun, and not just Indo-European myths: all myths. The most notorious of these writers, F. A. Paley (1815-1888), defended the view that all myths were the sun in an 1879 article on “Pre-Homeric Legends”:
There are some persons who read with utter incredulity the attempts of learned men to show that many of the legends of classical antiquity — even the Achilles and the Ulysses of Homer — may be readily explained by the ideas and the symbolism of a primitive sun-worship. They revolt from the theory as from a form of rationalism; and that, they are quite convinced, whatever be the subject to which it is applied, must, be something dangerous, if not positively wrong. In fact, they will hardly listen to the expounders of the theory, however good their claims to a fair hearing. "Everything,” they object, "was the sun, according to your view.” And the reply is not an irrational one: "Yes, everything was the sun, at a time and in a nation where the all-powerful and beneficent giver of light and heat engaged all the prayers and all the aspirations of the human race.”
Critics quickly understood that such solar claims rested upon a faulty premise: The myths, to become “solar,” first had to be “reconstructed” by modern scholars back to the “original” form from which they were supposedly corrupted. This reconstruction invariably found solar forms because the myths were assumed to derive from an ancient solar story! One critic took Müller’s theory to its logical limit. Müller’s name, he said, derived from the word for mill, and a millstone was, in Müller’s own writings, a metaphor for the sun. Therefore Max Müller was himself a sun god, created by a “disease of language”!
One of the most popular claims of the greatly expanded solar theory was that Samson, the Biblical hero, derived from (or was cognate with) Shamash, the Mesopotamian sun god. Thus, Samson’s hair became the sun’s rays, his death represented the sun setting behind the Pillars of the West, and Delilah became winter. At one point, no aspect of the Samson story escaped solar analogies. In the first decades of the twentieth century, this was the dominant understanding of the Samson story. However, by the 1960s and 1970s, scholars had firmly rejected a solar origin for Samson. James L. Crenshaw in his Samson (1978) noted that few if any modern scholars accepted the solar claims because of the great problems with Müller’s solar myth theory. Instead, the Samson story was at that time assumed to be a story of earth rather than the sun, with perhaps minimal solar influence. The most recent scholarly source I could find, Gregory Mobley, in Samson and the Liminal Hero in the Ancient Near East (2006), also concludes that the solar interpretation is fatally flawed, preferring an analysis based instead on liminality and widespread heroic motifs.
The name of Samson, though, does derive from a Hebrew word that is cognate with other Semitic terms for the sun. However, according to James Hastings’ A Dictionary of the Bible, there are two primary objections to recognizing him as the sun on those grounds: (a) Few if any other heroes take their names directly from the object they supposedly symbolize, and (b) Samson more likely got his name from Beth-shemesh (“The House of the Sun”), an ancient town on the border between Israel and the Philistines, in the exact valley where Samson operated. It is mentioned in 1 Samuel 6:9, and archaeological excavations at Beth Shemesh recently uncovered a seal depicting a heroic figure fighting a lion who may well represent an early version of Samson himself.
The solar myth theorists, however, did make an important contribution to scholarship. Although their broader theories were wrong, they were among the first to recognize the deep connections between the divinities of the Indo-European peoples, and that these derived from a much more ancient source. On that count, even in defeat, they scored more points for scholarship than all the ancient astronaut theorists combined.