How do you decide to give your baby medication for suspected pain?

I don't like giving my 9 month old son medication unless it's absolutely necessary... sometimes we think he's teething and maybe he's in pain from teething, but how do I know? When my son has pain from gas, I usually know because he arches his back or obviously, I hear him pass gas.. but how do I know he is in pain from teething?