Viagra, generically known as the medication , is a prescription drug primarily prescribed for addressing erectile dysfunction . It functions by enhancing blood circulation to the phallus, which allows men get and sustain an firm state sufficient for fulfilling activity . While usually safe when taken as prescribed by a healthcare professional , it'