Which pain medication works better?

No answer. The best drug is the one that works with the lowest side effect incidence. That will change between patients.
Also.. It also depends upon what is causing the pain.. Sometimes an anti convulsant or tricyclic anti depressant may work better than a narcotic for certain conditions.