Clients do not pay you for the code
I made $1000 over the weekend writing 10 lines of code. Only, that's not how I see it, and it's certainly not how the client sees it.
From my perspective, there were the two hours hypothesing on the origin of the problem. There were the two versions of the fix, as well as the three days of monitoring (waiting) to see if my hypothesis on the problem matched reality. And of course the creation of a development environment with Vagrant which took way.too.long.
From the client's perspective, client had a problem -- the system was sending out duplicate emails on an invoice, minutes apart, and clients and customers were complaining. #paypal
This was a classic case of problem solving -- the client had a problem, I quoted a price to solve it, and I solved it for client.
"It’s going great. Haven’t received any duplicates yet."
If I had charged hourly, I would have charged approximately $600 (4 hours * $150). More interestingly, if the client cared about the lines of code for the fix, client would likely have said "This was 10 lines of code, should this cost about $100?" -- your response to this situation should be along the lines of the carpenter analogy.
Homeowner has a creaky floor, and hires a carpenter to fix it. Carpenter comes in and walks around the wooden floor, takes out one nail, and hammers it into the floor with a swift and sure strike.
Carpenter hands over an invoice for $100. Homeowner: "$100?!?! you only used 1 nail! That price is unfair!"
Carpenter rewrites the invoice: 1 Nail: $1
Knowing where to nail it: $99
Clients don't pay you to write code -- if they had it their way, there wouldn't be code, there wouldn't be a "you".
Then what do clients pay for?
Clients pay you to solve problems. Sometimes the problem is an existing system that doesn't work quite right. Well, most systems don't work perfectly, so let's restate: "Sometimes the problems in an existing system annoy the client so much that they want to take the risk of fixing the problem."
Sometimes the problem is an underperforming website. Sometimes they feel the need to have a presence on the app store. Sometimes they enter data into excel so often that an automated (and glorified) CRUD app could simplify their life.
Save the client money, or make the client money. If you rephrase your proposed solution in those terms, you are justifying your project by giving the client a return on their investment in you. (Also this is a most excellent way of increasing a client's stated budget). Talking in terms of investment and roi beats talking "costs" eight days a week.
And that, my dear reader, is the core concept in consulting. You may be expensive, but investing in your will provide your client a positive return. You're proven; you've done this before. So the risk is lower for 'You at $15,000' than an 'oDesk for $750'.
You versus the outsourcer
Prospect: "Why should I pay you $18000 for a website when I can get {my-cousin|odesk|india} to do it for $500?"
You've probably wondered about this question. Maybe even dreaded it. I know this guy does. So what is your response to the question: "why are you worth $17,500 more?"
"You could go with the cheapest option - many people try this once. What you'll get is a shoddy product, built by someone who knows just enough to charge you $500. If you get the project completed, which is a huge if, you'll have spent literally days of your own time managing the developer, making change request after change request. You'll have spent upwards of 40 hours of your own time trying to get the smallest change implemented and I know from experience that you will hate the process. Did I mention they only work when you're asleep causing days to melt away unless you provide constant, dedicated attention? And that you (and only you) will be responsible for testing the project?
"If you look forward to that, I wish you the best. When clients choose me, they are choosing the cadillac experience. You'll get your project delivered on time, it will meet your requirements, and you'll enjoy the experience. Project management, testing, design -- these are all things I take care of for you, rather than dumping on you. I solve problems, and I can knock this project out of the park."