Erythromycin belongs to the family of medicines called antibiotics. Erythromycin ophthalmic preparations are used to treat infections of the eye. They also may be used to prevent certain eye infections of newborn babies, such as neonatal conjunctivitis and ophthalmia neonatorum.