It's simple economics and industry forces...
Demand for bicycle components is generally inelastic, meaning, even if prices are high, roadies are willing to pay for premium products, and demand won't decrease all that much (bikers have buying power). In some cases, elasticity is negative, meaning a price reduction would actually DECREASE demand, because the components would be perceived as lower quality (either implicitly by the consumer, or because a salesperson at your LBS says so to push the more expensive products).
So, even if a derailleur only costs $80 to make, they can get away with charging $800 for it. If they don't, and try to be "fair", their competitors will run them out of business...it's the case with most sporting goods, not just bike components.
Those of you saying it's because of R&D and marketing - you are *partly* correct, but R&D/marketing costs alone do not account for the sheer size of industry margins - most of it is just economics+industry forces.
Some may argue that this is exploits the consumer, but to be honest we make ourselves pretty easy to exploit.