Check the cage for anything sharp that might have injured your pet.
You can clean the sore spot with sterile saline or a little bit of 3% peroxide. You can then put a little bit of neosporin or triple antibiotic on it.
You can rinse the eye with sterile saline too.
Hamsters can have eye problems such as glaucoma or infections from a scratch or irritation.
You can try a mild boric acid eye drop or wash on the eye to see if that helps.
If the eye prolapses you can have the vet remove it and a one eyed hamster can do fine.
You can read more about hamster illness or injuries here
http://www.hamsterific.com/IllnessGuide.html
Hope this helps you!
Please press Accept if you find my answer helpful. Want more info? Just reply on your question!
Bonuses for good work are always appreciated!
Thanks for the opportunity to help you!