* Noun: A piece of cloth, especially an old or torn one. (Example: "She used a dirty rag to clean the table.")
* Verb: To tease or criticize harshly. (Example: "The kids ragged him about his new haircut.")
So, you need more context to know what part of speech "rag" is in a particular sentence.