The shooting, which appeared to be accidental, unfolded Monday in a parking lot in Rancho Cucamonga, the San Bernardino County Sheriff's Department said.