Make an object draw a line?
You can use dynamic painting.


Subdivide your cylinder to create a dense geometry. Give the ball a subsurf modifier and smooth it. Apply transformations to both objects (Ctrl+A).


Select the sphere and enable dynamic paint in Physics header. Set it as a brush and play with the marked red settings pictured below.


Select cylinder and set its type to canvas. Increase the sub-steps amount and check the anti-aliasing checkbox for smoother result.