Each ball knows it's own position and can read out the position of the other balls. So you can create an collision detection. It get's easier, if the balls are in a fixed order, so you only need to know the position of the next bal, or previous one - from whatever side you look at it.
To move the ball, you can use the linear function which just takes the current position as starting point and some value larger then this as end point.
Check out Dan Ebberts site for the collision detection: