Police say 36-year-old Joshua Luke Cummings was shot in the head and died at the hospital.
The shooting happened in front of the Hot Wells Gun Range on Highway 290 in Houston just after 9 a.m. Tuesday.
Investigators say an employee of the gun range was working on a hunting rifle when it suddenly went off.
At the same time, a customer had just gotten out of his car and was walking toward the building when he was hit.
Hot Wells Gun Range issued a statement saying, "We apologize in advance for the brevity of this response. We simply do not have the words to express the sorrow in our hearts. For 44 years we have operated this facility accident-free, yet today we are shaken by tragedy."
The Harris County Sheriff's Office said the case is being referred to a grand jury.