Police said the gunman approached the victim, asked for a cigarette and then pulled out a gun and shot the man. As the victim fled, the suspect fired several more rounds.
The first bullet struck the victim's teeth, the next shots missed him.
The victim was taken to a local hospital for treatment. He is expected to recover.
A motive for the shooting remained a mystery Tuesday night.
The shooter was described as a Latino man in his 20s, wearing a dark hooded sweatshirt. He was seen fleeing the scene on foot with two other people wearing similar clothing.
Anyone with information was asked to call San Bernardino police at (909) 384-5742.