Hhhmmmm, good question. First off, if you are doing well in a course and know that you need a LOR for somewhere or something, its always a good idea to try to stop by the professor's office, chat with him/her after class. Then again professors are usually more aware than what their students give them credit for. If you are applying in the 2006 cycle you have some time. And if you are having this same professor again, here is what I would do: I would formulate a little game plan and the goal is to get to know him/her. If he/she is open to questions after class, take advantage of it. If he/she has office hours, stop by a couple times. Doing so will not only make the task of asking for a LOR easier it will also make your professor's task a bit easier because he/she is more apt to write from a personal perspective versus a cold, objective one in which they merely describe your performance in class.
If you really need that LOR and can't do the above, then there is absolutely no harm in asking your professor. More often than not professors are quite flattered to have a student make such a request as it means that someone values their opinion, has made an impact on a student, and that student feels comfortable enough to approach him or her. I once approached a brilliant histology professor of mine with a LOR request. I was terrified - sure he was very likeable - but he was very accomplished and brainy. Long story short he was delighted by the request and confessed that the last time he had done such a thing was back in late 70's - he said most people were too intimidated to ask him but he loved writing them. You never know. Furthermore each of your professors was once in your shoes as they all had to go through a similar right-of-passage via matriculating into graduate school (and also science professors usually understand the journey of a pre-professional student pretty well).
Personally, and if you can do this, I would groom your professor prior to your request which should result in a better LOR. If there are just no two ways about it then ask him/her straight up, or if there is a better individual that fits the criteria go to him/her.