With web forms, such as the "post a comment" form at the bottom of a blog post, is it best to disable it by greying it out or to hide it? (Both with a message that you need to log in, obviously)
It depends on what you want to achieve. In the case of comment forms at the bottom of blog posts, do you want to lure guests into posting a comment? If yes, then the affordance granted by a visible comment form increases your chances of getting them to do so. If you hide the form, your options to make commenting an option are fewer (for instance, you could add a link to a comment form, which is less obvious than just having the form right there).
Stack Exchange sites show forms to unregistered users:
So even if you visit this site and have no idea how it works, you're still invited to answer. That's because UX.SE benefits by having as many people join as possible, so there's really no reason to hide a form.
Further, if the form is there, I might go ahead and start typing in it only to realise after spending a few minutes in it that I'm required to log in. "Oh well, I already wrote this whole answer, I guess I'll make an account," is a possible conclusion of that process. So you're breaking down barriers to entry.
So here are your options:
Again, depending on your goals you can choose one of the above options. In most cases I would recommend the 3rd option, but I don't know what you're working on or why, so you may want to do something else. In any case, when putting together something like a comment form, always ask yourself what your thought process would be as a user of this site. What would you expect to happen? If you have a hard time doing that, try grabbing someone in the hallway and asking them to post a comment. See what they do.
For purposes of luring people into joining, I like the idea of replacing the link with a separate message specifically tooled to attract them. Here is a great example of how powerful a little direct wording can be.
So for example: