You can register phrases or numbers as spam, to block incoming texts which meet the criteria. To block text message on Galaxy S3 and not to receive SMS from those spammed contacts, do as follows:
1. Open Messaging app
2. Press Menu Button and then select Settings
3. Scroll down and make sure Spam Settings is checked and then tap Register number as spam
4. Add contacts or numbers to blocked list (You may introduce some rules, like if the Name is the Same, or Starts with, or Ends with, or Includes)
5. Go back to settings and tap Register phrase as spam
6. Tap the Plus icon to add phrases that will cause messages to be blocked
7. If you check Block Unknown Sources then all the messages from unknown senders are blocked and identified as Spam
To view Spam text messages, open "Messaging" app, press Menu button and then select Spam Messages