Hi, welcome to PF.
There is indeed a certain energy assigned to the photon, which is related to its frequency [itex]\omega = 2\pi\nu = 2\pi c / \lambda[/itex] by
[tex]E = \hbar \omega = \frac{h}{2 \pi} \omega = \frac{h c}{\lambda}[/tex]
When we invoke the famous [itex]E = mc^2[/itex], the equivalence between energy and mass, we can indeed think of this energy as representing a mass
[tex]m = \frac{E}{c^2} = \frac{h}{\lambda c}[/tex]
The "rest" mass is usually defined by
[tex](m_0c^2)^2 = E^2 - (\vec p c)^2[/tex]
where p is the (three)-momentum. If we take this momentum to be [itex]\vec p^2 = m^2 \vec v^2 = (m c)^2 = (h / \lambda)^2[/tex] then this formula gives<br />
[tex](m_0c^2)^2 = (h c / lambda)^2 - (h c / lambda)^2[/tex]<br />
so [itex]m_0 = 0[/itex]. It should, because no massive particle can travel faster than light. <br />
<br />
These considerations are important in processes such as <a href="http://en.wikipedia.org/wiki/Pair_production" target="_blank" class="link link--external" rel="nofollow ugc noopener">pair production</a> and <a href="http://en.wikipedia.org/wiki/Electron-positron_annihilation" target="_blank" class="link link--external" rel="nofollow ugc noopener">annihilation</a>, where conservation of 'mass' (= energy) must hold.[/itex]