You should check out whether there is the problems for your eyes. You may have the infection at the eyes. The invisible bacterium may get into your eyes which needs your treatment. You should go to use some eye drops to make the eyes get clear and get moisture. At the same time, you could also use the warm compress to make your eyes feel comfortable.
All right, according to a lot of clinical cases, it is possible that your problem is derived from a lack of sleep or eye strain, because generally speaking, our eyeballs would not be painful when looking around. So, for now, you gotta get more rest and make proper use of your eyes. It is not a serious matter so take it easy and try to pay attention to your eye health in the future.
Unfortunately, you may get some eye problems. When you look to the side, your eye balls will turn, too. Pink eye, allergies, black eye and dry eye are all causes of eye pain. So the real reasons that lead to your condition is really uncertain. The best thing you can do is turn to an oculist for help and receive eye teat to determine your causes. By the way, the nerves problems in brain and migraine are also possible to cause eye pain when you look to the side.