NEW YORK (Fortune) -- Dear Annie: I'm in a terrible spot. About four years ago, right out of college, I got a job as part of a new-product launch team at a big consumer products company. Everything was going great. Then, two years ago, my boss was replaced by someone who just didn't like me. No matter how hard I tried, our personalities were like oil and water, and we just never clicked.
So I wasn't too surprised when I was among the first to get laid off during staff cutbacks last spring. The shock came last week. After several months of job hunting and half a dozen interviews that went nowhere, the hiring manager at one company where I applied recently called and told me my most recent boss, whom I gave as a reference, is saying bad things about me. (Among other negative remarks, he said I was "flighty.")
My old company has a formal policy in the employee manual against telling anyone anything except dates of employment and job title. Should I tell someone at the company that my old boss is violating the policy? Should I call him and ask why he is saying these things? Should I get a lawyer? [Unfortunately, my first boss there, who liked me, has since passed away.] Help! -- Just Joan
Dear J.J.: The hiring manager who tipped you off did you a favor. Most people who are being badmouthed by their references never find out who's saying what -- they just don't get hired.
Moreover, while most big companies (and many small ones) have a formal policy such as you describe, not all references abide by it. Heidi Allison, president of reference checking firm Allison & Taylor, says about half the calls her staffers make turn up unexpected trouble.
Even if a reference doesn't say anything definitely damning, he or she will often use a lukewarm tone of voice or vague, terse comments to put down a candidate, or to hint at less-than-stellar performance. As one former boss told an Allison & Taylor reference checker recently: "I'd rather not comment. You can take that however you want."
Have you ever suspected that your former boss was giving you a bad reference? Leave your comments at the bottom of this story.
"The fact is that most people have no trouble talking and, with a little prodding, they will often be surprisingly candid," says Allison. "You'd be shocked at what some references have said about candidates." Then again, maybe you wouldn't.
The first step in resolving the problem: Use different references. This was your first job out of college, but aren't there other bosses from previous part-time jobs whose names you could give instead? What about former colleagues who could say good things about your work? And this time, be sure and check with them first. Just in case they've forgotten how great you were, you can even give them a short list of accomplishments you'd appreciate their mentioning when employers call.
If you decline to give your old boss's name as a reference, and a hiring manager asks about it, you can say you never hit it off with this person and you doubt he's a fair judge of your skills and achievements. Then move the conversation on to the (far more interesting) topic of what you have to offer.
"At some point in their careers, many people run into a boss who just isn't a fan," says Allison. "Most hiring managers understand that -- and better you should say it up front than have them discover it in a reference check."
In the meantime, in case some prospective employers might still try to contact your old boss, consider hiring a lawyer to write a cease-and-desist letter. Jim Abrams, an attorney at Allison & Taylor, frequently writes such letters -- usually marked "personal and confidential" and sent by registered mail to the reference's home rather than his office. Why? "The purpose isn't to punish the bad reference by embarrassing him or her at work," says Abrams. "The goal is just to make the negativity stop."
What does a typical cease-and-desist say? It might point out that giving out information about a former employee beyond dates of employment and job title is in violation of company policy and -- depending on state law where you live -- possibly also a violation of the employee's privacy rights.
"Companies don't give out job-performance information about current employees to any stranger who calls on the phone, especially if the information is negative," Abrams points out. "So why do it to ex-employees?"
He adds: "One legal principle that applies here is 'intentional interference with economic relations.' Your skills and employability are property rights that a bad reference is taking from you. So we remind people of that, and of the fact that just because someone did not work out in one position at one company does not mean he or she won't be just fine somewhere else."
A stern letter from a lawyer is usually enough to make a bad reference change his tune, since no one wants the expense and embarrassment of a lawsuit.
If the letter doesn't do the job, you could get an injunction against your old boss, but that could also be costly and potentially awkward for your job hunt. Instead, Abram suggests, "consider going back to your old employer and requesting an internal dispute-resolution process like arbitration, which is usually available to both current and former employees."
This strategy will work in your favor if you ever decide to sue your old boss, he says, since "the courts tend to look harshly on companies that refuse access to these alternative methods." Good luck.
Talkback: Have you ever gotten, or suspected you've gotten, a bad reference from a former boss? Have you ever given someone else a bad reference? Tell us on Facebook, below.