Most doctors I know are, on average, smarter than most lawyers I know in terms of pure intelligence. My husband is a doctor, and is ridiculously smart. He took one look at my LSAT prep books and could get almost perfect scores right off the bat (very irritating BTW). Just looking at his work makes my head spin.
But I think lawyers tend to be more street smart, and may think more quickly on the fly. I am not sure that being more intelligent at the margins buys you much, since both lawyers and doctors tend to be very smart. And of course, this is all generalizations. I've met dumb doctors and brilliant lawyers, and vice versa.
Is this because the training makes them that way, or because people with that qualification are drawn to that profession more so than being, say, a doctor where they need to make life or death decisions quickly on the fly. (You can probably guess where I'm going with this).
Generally speaking, I would say doctors prove their intellectual chops through strenuous testing and training in order to get their degrees (assuming they didn't go to San Salvador Medical School and are real doctors and not chiropractors). That isn't to say all doctors are geniuses, as some of them are only slightly smarter than the average bear (follow some of the cases of practitioners with multiple malpractice cases against them). But still, it's easy to fail out of medical school and the bar is relatively high leaving the cream at the top.
I'd say that bar is lower for lawyers, scientists, engineers, etc. All of them have their members who could have excelled (and some have) in other fields (the guy who invented the first "home-computer" went on to become a practicing doctor). They also have their fair share of average quality workers, and those who barely cut it at what they do. I won't venture to guess which group is smarter because it'd require looking at the subsets within those groups as well to do just analysis (compare an IP attorney to one who does drunk-driving defense, or a theoretical physicist to one who does basic psychology research).