When you have a client whose market regularly overlaps yours, Chip Camden notes that it's important to communicate openly and frequently about boundaries and to be gracious.
Early in my consulting career, a client of mine (we'll call him John for the purpose of anonymity) met me at a conference we were both attending. He asked me to join him for a phone call to one of his customers to discuss how to solve a problem they were having.
After talking to the customer, it became clear that they needed a small custom software solution. I outlined how I thought it should work, and then (being a greenhorn consultant who was always on the lookout for new clients) I added "I could easily implement that for you, and I'm available for engagement."
John suddenly looked up, his eyes locking with mine.
"Or John could," I quickly added, "since you already have a relationship with him."
A hint of a smile passed over John's face as we thanked the customer and ended the call. Without words, John had taught me a valuable lesson about consulting: don't compete with your clients. That might provoke a "Well d'uh," but it's surprising how often you can step on each other's toes if you aren't careful, especially if your client's business involves providing technical solutions. In my case, my clients are all software developers, and some of them have customers who are also software developers. Some of my clients are also customers of one or more of my other clients, so those opportunities for misunderstanding abound. Imagine my consternation when, in addition to these complex relationships, one of my clients decided to create their own consulting organization that appeared to be in direct competition with my business! Fortunately, they're good people -- we've always been able to politely share that space (and even collaborate), and so far there's been plenty of work for both of us.
As with other difficult questions about consulting, the answer to this one lies in one of the consulting maxims: your success depends upon the success of your clients (#6 in that list). Therefore, it's better to give up some business than to take it away from one of your customers. Not that you can't offer to help them with the work itself -- but let your client decide how much of it they want, what part (if any) they'll delegate to you, or whether they're fine with you bidding on it separately. Even if you disagree with the wisdom of their decision (of course, you can voice that disagreement), taking it into your own hands is sure to spoil your relationship with that client. If you don't care about keeping that customer, go right ahead.
That seemed to be the thinking (if there was any) behind the way DEC treated its OEMs back in the 80s. I worked for one of its largest OEMs (in terms of hardware sales), and one deal in particular painted DEC's customer appreciation colors vividly. We had nearly closed a contract with a major tax preparation firm to provide their systems, software, and maintenance, nationwide. DEC jumped in at the last minute and offered to give them the hardware free of charge if they could have the maintenance contracts. They got that business (leaving the software as a problem for someone else to solve), but they soured their relationship with us. Between that and their failure to keep up with competing price/performance in the industry, we started actively looking for ways to get off DEC platforms. We were not alone. The DECxodus of software providers to Unix and DOS (and eventually Windows and the web) created or supported several emerging businesses, including one of my clients to this day. DEC serves as an object lesson that, no matter how much you may have going for you, if you screw your best sources of business, you can't succeed in the long run.
When you have a client whose market regularly overlaps yours, it's important to communicate openly and frequently about boundaries. Don't be too possessive, though. Try graciousness instead. I've found that clients generally return graciousness in kind, and only start getting nasty about competition when they think you're doing likewise. If your client ruthlessly takes advantage of your kindness, then perhaps they're not the kind of client you want to keep.