I won't pretend that there aren't crooked technicians in our industry. However, you'll find that most of unethical actions are on the other side of the table. Most often there is a miscommunication.
I find that taking time to explain things thoroughly, and not showing your frustration to a client when you're on a difficult call is very important. If you don't have the answer, collect as much information as possible, and advise them you need to research the issue. This situation mainly comes up on intermittent failures. Typically, if the unit doesn't work, the issue is a bit more obvious.
Most situations where the customer feels "ripped off", is when they don't feel they've gotten value from a call. Yes, you repaired the unit, and it's up and running. However, if you're there less than 5 minutes, collect a hefty bill for a run capacitor, and don't give much of an explanation, then they will look at it as over paying for a run capacitor.
So, take the time to look at the other components. Explain to the customer how the system is running, the immediate issue and part you had to replace. Mention some of the data you collected from some other readings. Go through a quick spiel on the integrity of the system, and what they might expect in the future. In most cases, this will turn their attention away from the "over priced" part, and understand that they just paid for a qualified technician to thoroughly check their system.
Remember VALUE MUST EXCEED COST, every time... You have to show value to the consumer.
As for the situation that you've described? Well, it happens but not that often. Most times it's the previous company just didn't care, rather than blatantly stealing.