I try to have the medications in liquid form so I can wipe it on their paws or nose.
Sometimes like John Hancock, they just flick it off, but some tiomes it works.