iOS users have been able to block phone numbers and e-mail addresses since the release of iOS 7. When a number or address is blocked, Messages, FaceTime calls, and even regular cellular calls won't ever show up on your iOS device.
When Apple released OS X 10.9.2 earlier this week, it not only patched a security issue, but it also added the ability to block contacts on a Mac for the first time.
Managing blocked contacts on OS X Mavericks is somewhat hidden.
To manage the contacts you currently have blocked, launch the Messages app and go to Preferences (click on Messages in the menu bar, followed by preferences). Make sure you're viewing the Accounts tab, and select the iMessage account you have added to your Mac, then click on "Blocked" to the right of the account name. iCloud takes care of syncing any number or e-mail address you currently have blocked on iOS to your Mac. But here's where blocking on a Mac gets confusing -- the phone number or e-mail address you want to block has to be part of a contact card in order to block it on OS X. At least, that's what I have experienced.
You can see what I mean by clicking on the "+" icon on the Blocked screen, and try to enter a random phone number. You can't. The app searches your address book and wants you to select a contact card. The same now seems to occur on iOS 7.
With that in mind, I suggest creating a single contact in your address book (call it "Blocked List" or similar) and add the phone numbers and e-mail addresses you want to block to this card. You will still need to come back to the Blocked settings and re-add the contact to update it, but this at least streamlines the process a tad.
Alternatively, there are controls to block a contact in both the OS X FaceTime and Messages apps respectively. In FaceTime, you can view a contacts information and click on the button at the bottom of the list to "block this caller." With Messages, you will need to click on the Buddies option in the menu bar, followed by "Block Person." Well, that's how it's supposed to work. When in a conversation with both contacts and non-contacts, the Block Person option was never available for me. I'm not sure what black magic is required to make it active.