In a cloudy day, people usually don't wear sunglasses when going out. The sunlight is not so strong so people often pay no attention if they eyes are expose directly to the sun. However, week sunlight doesn't mean week UV rays. Sometimes, UV rays are stronger on a cloudy day. Clouds can shade sunlight but can not shade UV rays. It is hard for people to look at the sun on a sunny day, but on a cloudy day, things are different. After been exposed to strong UV rays for a long time, there is no wonder way you feel eye pain. So, wear sunglasses next time or avoid looking up, you eye may not feel pain again.
It is really strange for your eyes to feel hurt in cloudy day because of the bad air quality. However you may check whether your eyes get infection because of invisible bacterium. You need to use some eye drops to moisture your eyes. You should also use the warm compress to release the symptom. You need to have a try.