How do erectile dysfunction medicines direct blood flow to the penis?

They don't. They prevent the opening of blood vessels that drain blood out of the penis, allowing it to become and remain erect.