Although in many ways Apple’s iMessage service is a great alternative to traditional carrier SMS/MMS text messaging, it’s sadly no more immune from unsolicited or unwanted communications—“spam”—than any other messaging network. Fortunately, Apple recognizes this and has provided a method to allow users to report spam that they receive through the iMessage network back to Apple, so the offending user(s) can presumably be dealt with. If you’ve received unwanted iMessages, you can simply take a screenshot of the iMessage screen by pressing the Sleep/Wake and Home buttons simultaneously, and then send it to email@example.com with the date and time that you received the message and with the full e-mail address or phone number that you received the message from.
Note that Apple can only deal with spam received through the iMessage network, which will be labelled “iMessage” on the conversation screen. Conversations labelled “Text Messages” are still sent through your carrier’s network, so you should contact your cellular provider if you’re receiving unwanted text messages. See Reporting unwanted messages sent from iMessage on Apple’s Support Site for more information.