  We report the distance and [Fe/H] value for the globular cluster NGC 5904
(M5) derived from the Fourier decomposition of the light curves of selected
RRab and RRc stars. The aim in doing this was to bring these parameters into
the homogeneous scales established by our previous work on numerous other
globular clusters, allowing a direct comparison of the horizontal branch
luminosity in clusters with a wide range of metallicities. Our CCD photometry
of the large variable star population of this cluster is used to discuss light
curve peculiarities, like Blazhko modulations, on an individual basis. New
Blazhko variables are reported.
  From the RRab stars we found [Fe/H]$_{\rm UVES} = -1.335 \pm
0.003{\rm(statistical)} \pm 0.110{\rm(systematic)}$, and a distance of $7.6\pm
0.2$ kpc, and from the RRc stars we found [Fe/H]$_{\rm UVES}$ = $-1.39 \pm
0.03{\rm(statistical)} \pm 0.12{\rm(systematic)}$ and a distance of $7.5 \pm
0.3$ kpc. The results for RRab and RRc stars should be considered independent
since they come from different calibrations and zero points. Absolute
magnitudes, radii and masses are also reported for individual RR Lyrae stars.
The distance to the cluster was calculated by alternative methods like the P-L
relation of SX Phe and the luminosity of the stars at the tip of the red giant
branch; we obtained $7.7 \pm 0.4$ and $7.2-7.5$ kpc respectively.
  The distribution of RR Lyrae stars in the instability strip is discussed and
compared with other clusters in connection with the Oosterhoff and horizontal
branch type. The Oosterhoff type II clusters systematically show a RRab-RRc
segregation about the instability strip first-overtone red edge, while the
Oosterhoff type I clusters may or may not display this feature. A group of RR
Lyrae stars is identified in an advanced evolutionary stage, and two of them
are likely binaries with unseen companions.
