Let us say that person "A" mentioned an idea for a software project on the web (ie. in a forum). Person "B" sees this idea and implements it. Can person "A" claim ownership of the idea? Has person "B" done something illegal by implementing the idea that person "A" posted?
Nobody owns the idea.
Nobody can own an idea. An idea is abstract and has practically no value on its own - it's the execution of that idea that is worth something.
Copyright refers to an actual creative work - i.e. the content or design. Recreating a similar work is fair game, you just can't appropriate the original work as your own, or use it for your own material benefit without explicit permission from the copyright owner.
If ideas could be copyrighted then we'd only have one operating system, one web browser, one search engine, one blog engine. That's not how copyright works.
Addendum: For people arriving at this question first time, the original question was tagged copyright and implied that there was actually a copyright issue. I realize that patent law is more germane to software than copyright law, and Jerry's Answer is an excellent one for explaining the patent side (the short answer is that patent law doesn't apply either, unless "A" actually implements the idea and/or patents it and "B" uses the exact same implementation).
Please do keep in mind, however, that the question still says nothing about filing for a patent, and I think that the question should be taken at face value; i.e. in the absence of "A" having any implementation or registration at all, does "A" have rights to the work of "B"? The answer is clearly no, and the copyright question is still worth answering because copyright is the only type of IP that exists implicitly.
IANAL, of course, and I disclaim any responsibility if you somehow manage to get yourself sued.
First, this varies by country. There is a degree of commonality between countries, but the details definitely vary.
@Aaronaught is correct, however, that you can't patent an idea -- patent law (at least in most countries) is clear on the fact that a patent must cover something tangible, not just an idea.
The US follows a "first to invent" system, so if both people filed for patents on the invention, the first one to invent it would be given priority. "Invent" doesn't necessarily mean "think of the idea" though - in fact, reduction to practice (i.e., implementing the idea) is usually the point at which something is considered "invented". A sufficiently detailed written description can qualify though, so if a question like that above came to court, it would probably go to the jury to decide whether the written description in question was sufficiently detailed to qualify as "inventing" or not. That would probably come down to a question of who much was left for somebody to figure out -- specifically, whether a "person of ordinary skill in the art" ("POSITA") would be able to follow the directions and produce a working result, or whether they'd need to complete the invention on their own -- i.e., the description left enough gaps that the POSITA wouldn't be able to implement it.
I should add that the courts tend to set the bar for a "POSITA" pretty low -- it's pretty well known that a lot of the most brilliant inventions seem pretty obvious after the fact. To compensate for that, they tend to treat a POSITA as somebody who does little more than follow directions. The definition of a POSITA is also used to decide whether something is "obvious" and in their ruling on KSR v. Teleflex, the US Supreme Court overruled a lower court decision on what would be obvious to a POSITA, loosening the definition a bit by adding an "obvious to try" criterion (i.e., they gave a POSITA credit for a little more intelligence and common sense, so you have to work a little harder to show that something you've tried to patent isn't obvious).
Most other countries follow a "first to file" system -- whoever files for the patent first is given priority. This eliminates most of the questions above (though there's still a similar question of whether something is obvious or not; though the law is similar in many places (e.g., in most EU countries) it tends to be interpreted more strictly in many, so what would qualify as sufficiently non-obvious to qualify for a patent in the US often won't in many other countries.
As usual: IANAL, and this post should not be construed as legal advice.
Reference: for those in the US, the real reference is US code, Title 35. §102 is probably the most relevant to this question. The link above to the KSR v. Teleflex decision is also highly relevant on the question of obviousness, and probably gives at least some indication of the kind of description that would be needed to qualify as invention.
I am not a lawyer, but I don't think that A can do anything. If you publish an idea on a public forum, and somebody uses it, and you haven't filed for a patent on the idea, then you don't have any protection. You have to file for patent protection in order to get any protection, and this is why you often see "Patent Pending" marked on products (since the patent has been applied for but not yet approved).
EDIT: As Aaronaught points out, even for patents the scope of legal ideas is limited to "inventions or processes". If the idea is an invention or process, then A could conceivably patent it after making the post and then sue B for damages. I'm not in a position to elaborate on the conditions and work required to do this, however.
Aside from patents, there are copyrights, trademarks, and trade secrets, none of which apply in this case.
Whoever implements it first gets to say every one else is a liar. People may spout a million ideas every day, but it does not matter: the fact you have implemented an idea means you have taken ownership of the idea.
It's safe to say this is a gray area where such activities can be contested as mere inspiration rather than the actual idea.
To my understanding, there is no way to own an idea, and once you have it, you need to decide where you'll share it. My suggestion is that you can do some research about your idea, but never let the whole picture to be seen.
So, basically the problem is that you cannot claim your ownership of the idea, unless you prove it, (like it happened with the Winklevoss brothers with Zuckerberg, not saying that I agree with any of them, but they managed to get a legal dispute over an idea with the propper documents and layers).
I recall reading at some place of the Getting Real book that you may have an idea, but it has no actual owner until you implement it.