Since the momentum is h/lambda (where h is Planck's constant and lambda is wavelength) the mass (in the sense you use the word) is just h/(c*lambda) or hf/c
2 where f is the frequency and c is the speed of light.
It turns out that this 'mass' is what enters into gravitational attractions. So photons of different colors do indeed have different weights. If you had a huge bag of blue photons it would literally weigh more than a bag of the same number of red photons.
Mike W.
(published on 04/19/2008)