The "solution" for many of Iran's gay population has been to change their sex (except in Thailand, there are more gender reassignment surgeries in Iran each year than any other nation). Because Iranian clerics do accept that people may be trapped in the body of the opposite sex, many gay Iranians are pushed into sex changes to avoid fleeing their country. Let's not confuse Iran as a haven for trans life, though - culturally forcing sex changes upon people so they can remain safe is not the same as being an openly accepting free nation for transgender people.
Saudi Arabia
Homosexuality is illegal in Saudi Arabia under the country's Islamic Shariah law, which states that any married man found engaging in homosexual acts can be stoned to death (yes, they still stone people). Outside of marriage, gay people are still executed in other ways, or imprisoned, flogged, and chemically castrated.
There is an underground LGBT scene in Saudi cities such as Dammam and Jeddah, but many people are afraid to even attend because of the frequent police raids (in June, for example, religious police in Jeddah's Harzat district simultaneously raided several "gay parties" all at once).
What's more, Saudi politicians don't think the nation is tough enough. Many are pushing for a crackdown on gay expats living in Saudi Arabia - they want to be able to immediately deport them.
Africa
LGBT people will be put to death in Sudan and Mauritania, plus certain regions of Somalia and Nigeria. In Nigeria, even heterosexual allies of gay people (i.e. those who "witness, abet or aid" gay life) can be punished by up to 10 years in prison. In 34 other countries in Africa, gay people are imprisoned and/or flogged. There's little hope for them in the present day, too, as they are faced with leaders who believe gay rights go against African cultural and religious values (and that they are a Western imposition, as Obama's experience last week proved).
On the contrary, however, it's permissible to be gay in Burkina Faso, Central African Republic, Chad, Côte d'Ivoire, Congo, Djibouti, Gabon, Madagascar, Mali, Niger, and Rwanda. In South Africa, moreover, marriage equality has been in place since 2006, making the nation a liberal aberration on the second-most-populous continent on the planet.
Russia
It's not illegal in Russia to be gay - it's just not something you're able to tell anybody about. While Russia doesn't uphold death penalty laws against its LGBT citizens, its laws forbidding gay expression make it an extremely oppressive place to be a homosexual. The "Russian LGBT propaganda law", as it's known, refers to the Russian federal law, which acts in "the purpose of protecting children from information advocating for a denial of traditional family values".
What does this mean, exactly? For gay people in Russia, it means anybody "promoting" homosexuality as being a norm in society will face arrest, detainment, and fines from the state. On the streets, they'll also face physical and verbal abuse in similar magnitudes to countries where homosexuality is illegal.
These issues were brought to light when Sochi hosted the Winter Olympics last year, but sadly the world has moved on and left Russia's LGBT population behind.
Australia
Australia certainly isn't one of the worst places on the planet to be gay - it is home to Sydney, known as one of the most gay-friendly cities in the world. But as it stands right now, it's the only major nation in the English-speaking world not to extend full human rights to its gay citizens, by way of marriage equality. For that reason, it makes this list.
Homosexuality has only actually been legal in all of Australia since 1994, so it's clear our trans-Tasman friends are always late to the party on gay rights. However, the current administration is being particularly stubborn on this issue - despite being pushed by lobbyists, protestors, celebrities and world leaders from the four corners of the globe.
Its unenlightened Prime Minister aside, Australia's strong religious influences - including the Australian Christian Lobby, Anglican Church of Australia, the Catholic Church, and Australian Federation of Islamic Councils - continue to be instrumental in preventing Australia from reaching the end of the country's long, bumpy journey towards offering full rights to gay people.