a line from surface of the cylinder to spheres

hi
i am new at opengl and i try to make a simulation with opengl.
There is a cylinder with tree small spheres on the cylinder.my purpose is when i click on the cylinder a line to be drawn from where i clicked to spheres on the cylinder.but when i clicked on the cylinder the line is adding centre of the cylinder.i want to add the line from surface of the cylinder where i clicked to spheres.how can i do this.
sorry for my english, i am new at english too.