What causes cancer (eye cancer or any other) is a very difficult question to answer. There are hundreds and thousands of researchers around the country and world who are trying to answer this question, as we hope that understanding its cause will be able to both better prevent and treat it. This is to say, we do not currently know what specifically causes each cancer. Keep in mind there are many types of eye cancer, and its cause and prognosis likely varies depends on the type. I would strongly recommend that you have your friend visit his ophthalmologist
(eye and cancer specialist respectively) for more information. This should be evaluated and treated in a timely fashion.
In general, we believe many cancers are caused by a "two hit" hypothesis. This theory goes as follows: many people who develop a cancer have some genetic predisposition to cancer. That is, it runs in their families. This is the first hit. Now everyone will not get the cancer, but are predisposed to it. Only the people who get a second "hit" will develop the cancer. Often this second hit is an environmental exposure (like smoking).
Other cancers are caused by viruses (like cervical) or environmental factors (melanoma).
It is hard to say why your friend got his cancer without knowing the exact type. Encourage him to see his doctor