In The Stranger, the sun is a symbol of the indifference of the universe toward humanity. While it is common in literature and the arts to present the sun as a benevolent force that brings life to crops and allows people to see in the daytime, Camus shows that the sun can also be an unpleasant force, with its intense heat and blinding glare. This is meant to show that the sun is neither a benevolent or hostile force, but an indifferent one: the sun, like reality, has no regard for humanity's comfort. It only exists as a neutral phenomenon to be taken as is.
The sun becomes linked to Meursault as well, since its glare is as close to a "motive" as Meursault has for shooting the Arab man. When the sun's light reflects off of the Arab's knife, it blinds Meursault for a moment. He is already agitated from the heat when this happens:
And then the Arab drew his knife and held it up toward me, athwart the sunlight.
A shaft of light shot upward from the steel, and I felt as if a long, thin blade transfixed my forehead. At the same moment all the sweat that had accumulated in my eyebrows splashed down on my eyelids, covering them with a warm film of moisture. Beneath a veil of brine and tears my eyes were blinded; I was conscious only of the cymbals of the sun clashing on my skull, and, less distinctly, of the keen blade of light flashing up from the knife, scarring my eyelashes, and gouging into my eyeballs.
He ends up shooting the Arab man several times for apparently no reason other than that the sun's heat and light makes him so uncomfortable that he becomes violent. It could be argued that the sun is then additionally a symbol of Meursault's final realization that life is absurd: people do things without reason or rationality, and life has no inherent meaning beyond the present moment.