Nitric oxide promotes the relaxation (dilation) of smooth muscles around blood vessels, increasing blood flow.
This action is mediated by the second messenger cGMP, which is converted to GMP by the enzyme PDE5.
The E.D. drug Viagra inhibits PDE5, thus prolonging the dilation and erection.