This is discussed (in considerable detail) in the Star Trek: The Next Generation - Technical Manual, considered to be a canon source of info about the Star Trek universe.
Subcutaneous and intravenous administration of many types of
medication is accomplished with the hypospray. This device employs a
pinpoint high-pressure low-volume microscopic aerosuspension stream,
which permits low-viscosity medication to be administered through the
epidermis without mechanical penetration. Certain types of medications
can be formulated for a somewhat wider spray pattern, resulting in
lesser penetration into the epidermis, but yielding a higher rate of
absorption due to the greater skin area exposed to the drug.
Standard hyposprays are designed to accept a standard medication vial,
which can be changed as required. Field hyposprays are normally loaded
with an inert saline solution that serves as a vehicle fluid for any
of five user-selectable concentrated emergency medication ampules.
The Star Trek: Encyclopedia also offers the following info, basically reiterating the text above.
Hypospray.
Medical instrument used by Starfleet medical personnel for subcutaneous and intramuscular administration of medication for many humanoid patients. The hypospray uses an extremely fine, high-pressure aerosuspension delivery system, eliminating the need for a needle to physically penetrate the skin.
Moving down the canon scale, the Star Fleet Medical Reference Manual has an entire panel showing the internal working of the "Air Spray Hypodermic Syringe".

