The corpuscular nature of light including the momentum and mass of a photon in a medium has been of extensive interest and controversy for hundreds of years. The elegant analogy between classical mechanics and optics done by E. Fermi has been extended in this work, and it is shown that for a quasi-monochromatic light (of center frequency ν) propagating in a medium of refractive index n, the photon momentum p= nhν/c, the photon mass m= nn'hν/c², where n' is the group index, and m= n²hν/c² for a monochromatic light, which can also be obtained through the ray equation.