It is strange. Actually your eyes will feel nothing hurt when you look at the sky. Your eyes may get infection because of coming invisible bacterium which you need to have the treatment. You may use the eye drops to moisture the eyes and get rid of the invisible bacterium. You could also use the warm compress to make the situation of the eyes get better.
Well, looks like you are pretty worried about your eye health because you are afraid of looking at the sky. So, from what I know, it would be quite common for anyone of us to have such feeling when look directly at the sky, for the sky, no matter what the whether conditions, gives out very strong light and that would make your eyes hurt. But you perhaps indeed have got photophobia, which is a disease making you afraid of sunshine or strong lights. Just try to consult a doctor and then take actions against your problem.
So when you look at a cloudy sky, you may not be looking at the sun directly, but it can still be too bright. You'll be straining, pushing the limits of your eyes' ability to block the excess light. Push it, and you may even damage your retina.