A captured soul will be put in the smallest available soul gem that will fithold it. So if you capture a lesser soul, and you only have a grantgrand soul gem available, it will be automatically put in the grand soul gem. If you have a empty grand and lesser soul gem, a lesser soul will always be put in the lesser soul gem.
If by chance you accidentally fill a larger soul gem with a lesser soul, you can drop it to the ground and pick it back up. Dropping soul gems to the ground causes them to lose the stored soul and this prevents the waste of larger gems filled with smaller souls.