To me, L was the smartest one. I was amazed the first time he quickly deduced the area of effect the killer(Light) could operate him by using a criminal as a distraction.
Light's plan in giving up the death note was pretty ingenious too, but imo L was at a bigger disadvantage. Light had a supernatural book, an almighty Shinigami, while having his dad nearby to give him necessary knowledge advantage concerning police movements, got an additional death note user(Misa) who conveniently became fan of Light, with Light using this to his advantage.
Yet despite all this, L uncovered most of Light's secrets, predicted his death and still managed to beat Light post-mortem through Mello / Near