A team of archaeologists from Tel Aviv University has unearthed ruins of a 3,100-year-old temple at the site of Tel Beth-Shemesh.
According to the story, the archaeologists, “This temple complex is unparalleled, possibly connected to an early Israelite cult – and provides remarkable new evidence of the deliberate desecration of a sacred site.”
The desecration in question, according to this story, is that when the Philistines took over, they not only destroyed the temple, but used it as animal pens.
Presumably the Philistines gained temporary control of Beth-Shemesh, and brought in livestock to live on what they knew had been a sacred site to their enemies.
Once the Philistines withdrew from the area, the descendents of the original worshippers returned to and religious worship resumed at the site.
In biblical terms this would have been around the time of the Judges. In the biblical account, at the time of the temple 1100 BC, Samson was living two miles away, across the valley in Zorah. It has been suggested that Samson’s name is a diminutive form of šemeš (sun), i.e. “little sun.” ‘Sunny’, maybe. Since Beth-shemesh means “house/temple of the sun [god]”, (Šamaš = the sun god), maybe there’s a link there.
As to the Philistines, a bit later, Beth-shemesh plays a prominent role in the story of the Philistine capture of the ark of the covenant (1 Sam 6:9–15). The ark is carried from Philistine territory to Beth-shemesh, which was a border town just inside Israelite territory.