It happened just after 7 p.m. Wednesday night at a gas station at the intersection of South Real and Wilson Roads.
Bakersfield police said the man was taken to the hospital with moderate injuries.
Officers are still looking for the person responsible.
If you have any information, call the BPD at 327-7111.
Copyright 2015 Nexstar Broadcasting, Inc. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.