I also lost motivation after my second year. It's a rough three years, I can tell you that. I recommend plowing through the exam and the bar while all the information is still fresh in your mind. Definitely take a bar prep course, they are essential to passing the bar.
As far as doubting yourself, I still do it. I work in criminal defense, for indigents, and it is a tough, depressing job. It can also be very stressful. I work very hard at relaxation and managing my work related and other anxiety. One great tip: once you leave the office, leave all work related thoughts there as well. My job is very depressing b/c all my clients are juveniles, and they just keep screwing up and eventually end up in prison. The job is also extremely reward at times, and that's what I live for. I had a client with a rap sheet a mile long, just involving domestic battery in the home. Well, at one point, he refused to leave the jail, stating that he would just be back in trouble if he went back home. Turns out his parents were beating the crap out of him with whips, brooms and other assorted weapons, and they would call the cops if he fought back. We got him into foster care, and I'm proud to say that on Thursday he will have successfully completed his probation. The whole difference in his life is that I helped to get him out of the abusive household. Cases like that make up for everything else you have to put up with.
Law, at this point, is working out for me. But if it doesn't work out for you, there are tons of law related jobs that don't require that you practice law. Just do whatever is right for you.