Get your refraction done and wear spectacles
eat green veggies. Carrots. Strain less your eyes. Relax your eyes in between work. Blink regularily if working for long time on computer. Lower the brightness of your screen. Work under adequately illuminated conditions. If needed wear corrective spectacles. Get your refraction done and wear spectacle. Is that pain
associated with redness, diminution of vision or any other symptoms? if yes then it's of infective origin. Else if none of these present and you are using /not using glasses in either case get your refraction done. May be the number might have changed. If your vision is normal, you have to go for orthoptic checkups which may be probable cause for asthenopic symptoms.