Fortunately, there are steps that you can take to mitigate this danger. Investing in a solid pair of polarized sunglasses and using your visor can both help to reduce the chances that the sun catches you off guard.
Keeping your windshield in optimal shape will also help to minimize glare. You can do this by keeping it clean and taking care to repair any cracks. The dashboard should also be clear of papers or other objects that might block your view of the road.