Like everyone has said, freezing the leaves does not work. You can, however, put the basil blooms in some olive oil with a little salt, whir in a blender or food processor, and you've got a great drizzle for a salad or chicken, pasta salad, etc. This will last for several weeks in the fridge.
If you use it right away you can add a clove of garlic, again whir in a blender or food processor, and don't keep for more than a week (be sure to keep in fridge though).
You can easily freeze the first mixture for future use. Put in ice cube trays then pop out when frozen and toss in a freezer ziplock bag. This can easily be used in pasta dishes and soups.
The best way to freeze basil for pesto is just to make some pesto and freeze it. I do it all the time. Even if you have to make a small batch.
"Count yourself...you ain't so many" - quote from Buck's Daddy