Homoclinic chaos for ray optics in a fiber