Here is a timely article from David Pogue of the New York Times on how to stop most unwanted, advertising and nuisance text messages:

AT&T: Log in at Under Preferences, you’ll see the text-blocking and alias options. Here’s also where you can block messages from specific e-mail addresses or Web sites.

Verizon Wireless: Log in at Under Text Messaging, click Preferences. Click Text Blocking. You’re offered choices to block text messages from e-mail or from the Web. Here again, you can block specific addresses or Web sites.

Full article and advice for other carriers is here.