Well, generally speaking, it can be normal to have painful eyes after you have taken the eye exam. In common, when you have an eye exam, it will make your eyes focus on the points for a long time. And then the light can go through your eyes to check it. In this way, it can lead to eye strain. And then lead to eye pressure. Finally, it will just cause eye pain sometime. Also, eye pressure can lead to some eye problems, such as itchy eyes.
Does your ophthalmologist shine the bright light to your eyes? Or does your ophthalmologist drip any eye drops into your eyes in the course of eye exam to make the pupil larger so that he could have a better look? If so, you will probably feel better after a period of time. But if you do not recover, or even feel worse, you had better ask your eye doctor to have a check of your eyes.
Well, it seems that there is something wrong with your eyes, and generally speaking, eye exam could not bring pains to your eyes. Anyway, I wonder if the doctor has applied something to your eyes. And maybe you have focused on something much too bright, such as the E map or the examiner equipment. It is ok if you get some rest, and if the problem keeps lingering on, try to see a doctor.