You could be having an acute infection of the glands in the eyelid..
You can try doing some warm compresses..
If it doesn't come down, you have to use topical antibiotic
eye drops and ointment along with/without oral antibiotics(depending on severity).
You can use any pain killers if the pain is severe..