each lens has a optimal aperture value. Maximum sharpness is obtained for this value. Larger aperture (=smaller f values) are softer, and smaller aperture (higher f values) are affected by diffraction problems.
Photozone has a comprehensive set of tests of image sharpness at various aperture value
http://www.photozone.de/Reviewsjust go to the MTF results diagram and read the aperture corresponding to the maximum number of line widths/picture heigth. This cvalue is the optimal aperture setting.
You will realize that the optimal aperture of a bright lens (= one with a wide max aperture) corresponds to a wider aperture than a lens with a narrower max aperture. In other words, the optimal aperture of a bright lens will be lower than the optimal aperture of a darker lens .
exemple: lens A: max aperture f=1.8, optimal aperture = f:5.6
lens B: max aperure f:4.5, optimal aperture = f:8
Between f:8 and f:5.6, the amount of light is 3 times lower. This means with the darker lens, you will have to lower the speed by a factor 3, or triple the ISO setting, and these parameters contriburte to lower the image quality.
So yes, large max aperture lens are more expensive, but in actual situations, the benefit on image quality is usually worth the price....