If it's liquid medicine, try wrapping him in a towel or blanket so only his head is exposed. Make sure his body is secure, then get hold of his head and tilt it slightly up and back while using your hands to gently open his jaws (you might need someone to help you with that part).
Squirt the medicine directly into the middle of his mouth, then close his jaws and gently massage the outside of his throat (using a downward motion). With any luck, he'll swallow involuntarily and down it goes!
This is a lot easier if you have a smaller dog.
As soon as I try to pick my dog up (Shih Tzu), he starts growling and then bites me. I've worn gardening gloves and he still breaks the skin. He's on heart medicine and has to take it.
It sounds like he's conditioned to know it's coming. Is it an everyday dose? I don't know what you could do other than try wearing barbecue mitts (they might be sturdier than gardening gloves) or ask your vet about possibly giving him a mild tranquilizer beforehand so he'll be calmer when it's time for the heart medicine. Good luck though!