In this protocol, we describe the imaging of single axons in the rat optic nerve in vivo. Axons are labeled through the intravitreal injection of adeno-associated viral vectors (AAVs) expressing a fluorophore (duration of the procedure ∼1 h). Two weeks after intravitreal injection, the optic nerve is surgically exposed (duration ∼1 h) and labeled axons are imaged with an epifluorescence microscope either for up to 8 h or repetitively on the following days. Additionally, intravitreal injection of calcium-sensitive dyes allows for imaging of intra-axonal calcium kinetics. This procedure enables the analysis of the morphological changes of degenerating axons in the optic nerve in different lesion paradigms, such as optic nerve crush, axotomy or pin lesion. Furthermore, the effects of pharmacological manipulations on axonal stability and axonal calcium kinetics in axons of the central nervous system can be studied in vivo.