expression, godan verb (-tsu)
inject drugs; shoot up
Slang for injecting illegal drugs, especially narcotics. 薬 here refers to illicit substances, not medicine.
彼は裏通りで薬を打っているところを警察に見つかった。
He was caught by the police injecting drugs in a back alley.
Neutral term for giving an injection, including medical contexts. 薬を打つ is specifically slang for injecting illegal drugs.
Compound of 薬 (drug) + を + 打つ (to hit, to inject). The use of 打つ for injection is colloquial.