It looks like an eye infection of some sort. You may want to contact your friend as this dragon needs to see a vet asap. As to what caused the problem in the first place, there are many possible causes, depending on exactly what is wrong with the eye.
Does your friend use a compact UVB bulb in the cage? this can cause some eye problems, but from what you describe I doubt this is the problem, whether she uses the compact UVB bulbs or not. Any eye discharging fluid/pus is a very good indication of infection, either of the eye, eye socket, tear duct or lids and this needs to be brought to a vet to diagnose and treat.
If your friend hasn't left instructions for you on what to do in an emergency, contact your friend, find out if he's willing to pay or reimburse you the vet costs if you take the dragon in asap. If not and its going to be some time before your friend returns, I would still suggest bringing the dragon in to see a vet anyway. Last thing you want is for the dragon to die and your friend claims you did something to their dragon to kill it.
If it was me personally, I would treat the dragon and if my friend came back and refused to reimburse me for the vet bills, I will just keep the dragon till they do. I will however, tell them this on the phone, so they know what to expect when they come home to find their dragon missing. Its the owner's responsibility to ensure the health of their pets, no matter what it is. If they are not willing to provide care...then I wouldn't let it suffer till they got back and continue to suffer afterwards.
-----
PHLdyPayne