It might be caused by the sensitivity to light. Sensitivity to light can be called photophobia referring to inability to light. Light would cause discomfort or even headache, with an urge to close eyes or squint. Photophobia itself is not an eye disease but a symptom of various eye conditions, for example infection or inflammation. It could be an indication of some underlying disease for example severe migraine. There are still many possible reasons for light sensitivities, including corneal abrasion, keratitis, uveitis, central nervous system disorder and so on. To find out the optimal treatment, you should visit your doctor to see what caused your increased light sensitivity. Polarized sunglasses would effectively reduce the glare which might irritate eyes. Make sure to wear sunglasses to protect your eyes whenever you are possible to be exposed to strong light. Some glasses lenses with special coating can also reduce the impact from glare or strong light.
When you are driving at night, you will see a lot of glares and reflective light on your eyes, which can cause strain on your eyes, so your eyes will feel hurt. What's more, the headlights will do harm to the retinas of the eyes. It may also be the reason that you have astigmatism and so you will need glasses.
Your eyes may get infection or dryness because of the lots of use of eyes in front of the computers or other electric products. That is why you feel hurt at the eyes when you drive at night. You could use some eyes drops with anti-inflammation role. You could use the warm compress to make the eyes feel comfortable.