Hello Teo
Normally, "the". But for effect, you could use "a": what is countable then is the occurrence of the phenomenon "the sun setting", rather than the sun itself.
Alternatively, some readers might envisage other suns in other solar systems.
MrP