One can argue over who is the smartest in this:
Light: He's the mastermind behind the entire plot. He's been doing what he's doing right under L's nose without being caught. Plus he also tricked a shinigami into killing himself. He tricked all those around him into believing that he was innocent, using various methods to foil others.
L: He was always suspicious of Light. He basically already solved most of the case. The only problem was that he was unable to find the evidence to convict Light.
Mello: Personally, I think he's the dumbest of the lot, so I won't comment any further.
Near: He was the one who actually solved the case and was able to catch Light doing it, but, personally, I think that his win was more due to the mistake done by (I forget what his name was. That guy with the glasses). Things would most likely have drawn out if not for that.