Man uses gun to rob pharmacy of narcotics