Remain still. Ask the owner it it's all right to pet.
 
Slowly move your hand in an upward motion in front of the dog's nose.
 
Move slowly. Rub the side of the dog's head. Stay an arm's length away.