The important thing to keep in mind is that you're not there to do you boss a favour and he's not giving you a job to do you a favour (that doesn't mean you can't, or shouldn't, be nice to each other, and do each other favours - but it's more of a long-term view of the situation).
Market pay is whatever you can make someone pay you. If your current employer can't pay you more, either you're not producing enough value, or the value you're producing is being inequitably shared with others in the organisation. Very often in engineer-driven, but non-engineer-led business, this could mean a too big or over-paid sales force. Both is a sign of inefficiency.
Chances are if you are on good terms with your boss, you can explain this to them. If they still can't give you a raise, explain that the situation compels you to dip your feet in the water (ideally, you've already done this as the conversation has the potential to sour the relationship with your boss).
As always, pull a patio11 and make sure you can articulate the value you're adding in terms of the money you bring in - this always comes easy to sales people (because, well, it is easy - they physically bring the cheques into the building). You've never just refactored component X. You've refactored component X which allowed your team to deliver high-value feature Y to the client, which you believe was brought up as a deciding factor in the contract renegotiations.