The victim was walking on Harbor Road just before 7:30 a.m. when she heard a loud argument between two groups of people followed by gunshots, San Francisco police spokesman Albie Esparza said.
The woman felt pain in her lower body and realized she had been shot, according to the spokesman.
She was taken to San Francisco General Hospital to be treated for a graze wound that is not considered life-threatening, Esparza said.
The shooting is under investigation and anyone with information about the suspects is asked to call San Francisco police.
Callers may provide anonymous tips to police by calling (415) 575-4444 or by sending a text message to TIP411.