Sit down with your boss and chat.
"It's starting to look like Joe might be put in charge of this team. Is this a possibility?"
If not, then your fears are unfounded. He may ask a few questions to understand why you're asking, answer truthfully and move on - it's not a problem and you can stop worrying.
If so, express your concern, and ask him to help you understand what alternatives you might have:
"I see. Having worked with him on this team for some time, I believe that personality conflicts between the two of us, which don't clash as peers, would cause unnecessary conflict under a leadership relationship. This would be counterproductive for both of us and the team as a whole. If this does happen, are there other teams or projects I could be moved to so as to avoid this issue?"
Your boss, if he values you, doesn't want to lose you, but hopefully he will understand and will either take your concern into account and choose to not advance this other person, or rearrange the projects so you aren't placed under him. Your boss probably won't be keen to give you to another leader in the company, but if they are interested in the success of the company then they'll consider that as well.
Understanding the structure of your company, and what your boss's professional, and personal, goals are will make it easier for you to help him work towards your goals while also meeting his own goals. So you might spend some time trying to understand your boss, how he fits into the organization, and what he's aiming for in the near and far future.
Another option is to make yourself capable of, and available for, the leadership position of your team. Perhaps you'd prefer serving in the trenches, rather than leading, but compare the pain of serving under this person you don't like to the pain of leadership. It may be your better move overall, and can give you a great deal more self-determination within the company, not to mention a better opportunity later if you need to leave the company, or advance within. Be prepared for the inevitable few people who approach your boss to tell him that they can't work under you though. ;-D
Lastly, your own attitude can often be adjusted, and if so you may be able to find a way to make things work. Don't assume that it's a defect in his personality - you are responsible for your own happiness and success, regardless of those around you. If you are objective about the situation, you may find the ability to work effectively and still enjoy your work under him.
Keep your resume up to date no matter what direction you go, and be prepared to find another job.