the function of medullary rays is to carry chemicals which fight invasion by insects and fungi, and block any damaged areas. the cells deposit tannins and resins which block up the damaged area. this process is called "tylosis".