If you play golf long enough it is inevitable that your golf ball will come into contact with another golf ball during a round. Many factors are involved to determine what do with your ball after it came in contact with another ball. Those factors are: was it at rest or moving because of a stroke, what part of the course was the ball played from, where did it come in contact with another ball.
Let us examine the most common occurrences…
Your ball is at rest anywhere on the course and another ball hits your ball and moves it
No penalty to you, and replace your ball. If you are uncertain of the spot, you must estimate the spot and place the ball.
You make a stroke from anywhere on the course, except a putting green, and your ball hits another ball
No penalty to you and you play your ball from where it came to rest.
You make a stroke from the putting green and your ball hits another ball that was at rest on the putting green before the stroke was made
Match Play – no penalty and you play your ball as it lies.
Stroke Play - you earned a two-stroke penalty (general penalty) and must play your ball as it lies.
You make a stroke from anywhere on the course except the putting green and your ball collides with another ball in motion
There is no penalty to anyone and you must play your ball as it lies
You make a stroke from the putting green your ball accidentally collides with another ball in motion on the same putting green
There is no penalty; however, you must cancel the stroke and a ball must be replaced on its original spot and replay the stroke.
Rule 11 is where you can find more on these rulings.