Yes, strong sunlight will cause pain on eyes because of the uv rays. If you have to stay a long time in the sun, you'd better wear the sunglasses to protect the eyes from the uv rays. Or else, your eyes will get red and painful because of the shining sunlight. You should better protect the eyes in the sun because the eyes are the so weak parts in the whole body.
As far as i know, mild sunlight won't cause hurt to eyes. But if you expose in intensive sunlight for a long time, you may feel burning eyes and even headaches. So, what environment you stay right now? If you stay mild sunlight and feel eyes hurt, it may caused by other factors such as trauma, eye allergies or pink eyes etc. So, you shall check your eyes first so as to know what's wrong with your eyes.
Well, It looks like you are not comfortable when exposing your eyes to sunshine. It seems strange right? However, I could say, almost all of us would have such feeling to some extent, for sunshine is much too strong to be looked at. And it is also possible that you have got photophobia, which would make you feel bad in that situation. So, if you continue to feel that way, you'd better visit a doctor!
Well, it is normal for many people to have this kind of situation just like you. So you do not need to worry about it, and it can be fine. Generally speaking, when you go outside where there is strong sun, and the light is so strong that when you open eyes to see it, and the light gets into your eye ball. And of course, our eyes are so very sensitive that they will react to the stimulation from sun light. In that way, so it will just make the eyes hurt. And we can say that it is the reaction to the strong light. On the other hand, there is also because of the irritants in the air outside. And when you go out, your eyes are easy to be infected by them. For your situation, you can just wear sunglasses to protect your eyes.