Choosing your advisor is like choosing your spouse.
I would say more like choosing your parent since the advisor-student
relationship is not symmetrical. But the point remains: No single
decision will make or break your graduate career more than the choice
of advisor.
A good advisor serves as a mentor and a colleague. Someone who will
represent you, fight for you, challenge you and push you but not
belittle you or take advantage of you. He or she will direct your
research to primarily address your future career. An ideal
advisor-student relationship will develop into a mutually strong
research environment and will last well beyond the student's graduate
career.
You should ideally choose an advisor whose expertise matches your
research interests. But more importantly you need to find the advisor
with which you can have a strong working relationship. You don't have
to see eye-to-eye on every issue but you need to have mutual
respect. Like in marriage, an advisor might work well with one kind of
student but not with another. You need to find the right advisor that
fits your needs and personality. If the advisor relationship goes sour
for any reason, you need to change advisors. Being stuck in bad
advisor-student relationship is almost a guarantee of a disastrous
graduate career.
When I started grad school there was no web. So there was no way of finding details of research interests of a wide range of Professors as it is possible today. I simply selected the most senior faculty member of the university as my advisor. During my grad study, I really enjoyed working with him. He was very ethical and a pleasant person to work with. However, looking back, I wish had selected a younger, more aggressive advisor. My advisor used to sit on my papers for over 6 months each :-(
The "choosing a parent" analogy has another good point in it: Much of it is about luck. Depending on the field of study choices could be limited, and it is quite hard to get indications about the future working relationship.
But some informed choice is still possible. When just-beginnning grad students ask me about how to choose an advisor, I usually tell them that among other things it is a good idea to grab some of the would-be advisor's current students for a chat.
It is always a good idea to work with a would-be advisor for a bit and see how it works out, before deciding on an advisor.
Unfortunately at many schools, this is not an option and students have to pick an advisor before starting grad school, or very soon after. I think steps need to be taken to fix this.
Talk to older graduate students for advice, especially, those of the professor you are thinking of working with. They will have a much better idea of who is better to work with than you.
I am torn in commenting on this post. I agree with some of this sentiment -- choosing a bad advisor, or being stuck in a truly bad student-advisor relationship, can truly be bad for one's career. I was almost stuck with a bad advisor, but a more senior student warned me off my choice before I made a tremendous mistake. (This student had the poor advisor, and knew from experience...) I have since seen bad advisors hurt others' careers many times.
On the other hand, I think you exaggerate the impact of the advisor dramatically. In the cases I know of, when the student was good, the bad advisor turned out to be a temporary setback, but by no means the end of the career, for the student. In my own case, I found I performed best when my advisor left me alone to do my own thing, and in fact I know of many cases where this was true.
In the end, I think a student's graduate career is based on their own drive and talent than on anything else. Advisors can be helpful or harmful, but only in limited ways, and to suggest otherwise exaggerates their importance, and diminishes the students' responsibility.
It depends on the student. Some students are talented independent spirits that can come up with research questions (and answers) on their own, and are best left to their own devices, with minimal supervision. Others (most?) benefit much more from working side by side with an experienced researcher and learning from that.
I think that being stuck with a bad advisor can really be detrimental for a lot of students. An advisor is not just an employer, but he is supposed to be someone who has excelled in some field for which you have an interest, and from whom you hope to learn tricks and research strategies for your future endeavours. I don't believe in advisors babysitting the students, but I strongly feel an advisor should share some passion with his/her students and be there for some active research discussion. Bad relationships or scarse interest in working with your students shows a lack of interest in being an academic role model, which in my opinion defeats the purpose of working in an EDUCATIONAL environment. I'd suggest reading the book "A ph.d. is not enough" by Peter J. Feibelman. It can be enlighting.
In academia, things work by recommendations, reference letters etc. If you have a advisor who will not say nice things about you in the letters he writes, then it can be a setback for academic career and promotions. Not so much if you decide to go to industry. So if your plan is work in academia, choose advisors with extreme care.