Nassau County police say the robbery happened at 3:30 p.m. Friday in Bellmore.
Police say a man entered a pharmacy and demanded Ritalin and the painkiller Dilaudid.
The pharmacist complied, but followed the robber outside.
Police say the bandit pulled a knife. The pharmacist fired once, hitting the ground and the suspect's car.
The robber sped off, but an ambulance driver later spotted the car.
Police arrested 43-year-old Marc Gumpert, of Freeport.
In 2011, five people died during two pharmacy robberies in Medford and Seaford.