Androgen receptor

Steroidal anti-androgens
Steroidal anti-androgens have a similar chemical composition to one of the androgens (testosterone or DHT.) These bind to the Androgen Receptor (AR), preventing Testosterone/DHT from activating the receptor, but as an 'antagonist'/'partial agonist' it doesn't "turn on" the AR to a significant degree.

5α-reductase (5AR) inhibitors
Testosterone has roughly 100x less affinity to the androgen receptor than dihydrotestosterone (DHT). 5α-reductase enzymes convert testosterone to DHT. 5α-reductase inhibitors such as Finasteride and Dutasteride are antagonists of this enzyme, preventing DHT production rather effectively. However, 5AR is a critical step in the synthesis of important neurosteroids such as allopregnanolone. Therefore, blocking 5AR may have undesired psychiatric effects.

Epigenetics
The yellow things are Androgen Receptors (ARs) latched onto regions of DNA called Androgen Response Elements (AREs). The promoter and the enhancer AREs are normally separated by thousands of base pairs. The big blue blob off to the right is RNA polymerase, which reads DNA and produces an RNA “blueprint” that will be translates into a protein eventually.

The gene that testosterone tries to stimulate in this picture is named PSA, and it is next to the enhancer. Normally it doesn’t get produced because its DNA is spooled up around a wheel-shaped protein complex called a histone (behind the white strip of DNA in the picture, with little “-Ac"s hanging off of it.)

When testosterone binds to the ARs, the Histone Acetyl-Transferase (HAT) protein CBP whacks on an Acetyl (-Ac) group onto the histone nearby. This makes the DNA wrapped around it unspool, and pushes it away from nearby histones so that the DNA is exposed and wide open.

Now that the DNA is unspooled, the ARs connected to the promoter ARE and the ARs connected to the enhancer ARE (thousands of bases down the film of DNA, remember) snap together, bridged by that big protein called CBP. That makes RNA polymerase jump onto the enhancer ARE, skip the few thousand bases in the middle of the loop, and start transcribing the mRNA for the PSA protein.

Once we stop having testosterone in our bodies, those histones stay unwound because those Acetyl groups stay in place on the histone, and the gene will keep getting transcribed.

But! Androgen receptor antagonists (E.g. the prostate cancer drug bicalutamide) actually make corepressor proteins like HDAC1 snap in, instead of HAT! Those snip off the -Ac groups like pruning shears.