He needs to see a vet. There is no over the counter medication you can give a dog safely for pain. DO NOT give aspirin!
If your dog hasn't been seen by a vet then you probably want to take it to a vet. You can give him an aspirin for pain but I really recommend that you take him to a vet.
Thanks! Your answer is awaiting moderation.