We combined local photolysis of caged compounds with fluorescence imaging to visualize molecular diffusion within dendrites of cerebellar Purkinje cells. Diffusion of a volume marker, fluorescein dextran, within spiny dendrites was remarkably slow in comparison to its diffusion in smooth dendrites. Computer simulations indicate that this retardation is due to a transient trapping of molecules within dendritic spines, yielding anomalous diffusion. We considered the influence of spine trapping on the diffusion of calcium ions (Ca(2+)) and inositol-1,4,5-triphospate (IP(3)), two synaptic second messengers. Diffusion of IP(3) was strongly influenced by the presence of dendritic spines, while Ca(2+) was removed so rapidly that it could not diffuse far enough to be trapped. We conclude that an important function of dendritic spines may be to trap chemical signals and thereby create slowed anomalous diffusion within dendrites.