It is the second time he has been attacked with zelyonka ("brilliant green" in English) this year.
The dye is a common antiseptic in Russia and has been used in protests there and in Ukraine.
"It looks funny but it hurts like hell," Mr Navalny tweeted.
It is not clear who carried out the attack, which happened near the offices of the Anti-Corruption Fund (FBK) that he founded.
According to one report (in Russian) he was diagnosed with a chemical burn to the eye.
Mr Navalny is one of the foremost Russian critics of President Vladimir Putin and has announced his intention to run for president himself.
But his intentions may be thwarted - he has been convicted of embezzlement, which would bar him from running for office, although he denies it.
A new weapon of choice - Vitaliy Shevchenko, BBC Monitoring
A mild antiseptic known as "brilliant green" has recently become a weapon of choice against government critics in Russia.
Mr Navalny has been doused with it twice this year. One of Russia's most popular bloggers, Ilya Varlamov, had it thrown at him twice on the same day on 26 April. And pro-Western politician Mikhail Kasyanov had it splashed in his face at a rally commemorating murdered opposition activist Boris Nemtsov.
So why brilliant green? It stains the skin and is hard to wash off, which can be a problem if you want to take the media spotlight. Also, it doesn't do any lasting damage, which means attackers will not be facing charges of grave bodily harm.
But the attackers don't always have the last laugh. When Mr Navalny was last doused he turned his green face into an internet meme and was imitated by his supporters.
Mr Navalny was among 500 people arrested after organising an anti-corruption rally last month. Rallies across the country were the biggest opposition demonstrations in Russia in several years.
He has said repeatedly that he wants to challenge Vladimir Putin's control of the Kremlin and expose what he claims is the "myth" that Mr Putin commands more than 80% popular support.
Meanwhile a separate opposition group, Open Russia, says its office has been raided by police, a day after the group was blacklisted by the authorities.
Activists said more than 20 riot police raided the office and removed computer equipment and 100,000 flyers for an unsanctioned rally planned for this weekend.
Open Russia was founded by former oil tycoon Mikhail Khodorkovsky, who lives in exile after spending 10 years in a Siberian prison on fraud charges, which he says were politically motivated.
|It is the second time Mr Navalany has had dye thrown on him this year. @NAVALNY|
Russian Opposition Leader Alexei Navalny Hospitalized After Latest Attack
Russian opposition leader Alexei Navalny was hospitalized on Thursday, after an unknown man attacked him outside his office in Moscow. The assailant sprayed a green antiseptic into Navalny’s face, drenching his right eye in the noxious chemical.
“What is really unpleasant is that it got in my eye. My right eye is now completely green — both the pupil and the cornea,” Navalny wrote on Twitter.
Translation: “The ambulance came, looked at my dark-green eye, and said that they're taking me to the hospital. They wrapped up [my head] like it'd been seriously injured.”
“It looks pretty funny, but my eye hurts like hell,” he later added, sharing a photograph of his bandaged head and dyed face.
First aid workers soon arrived to examine Navalny’s injuries, and determined that he should be taken to the hospital for further examination and treatment.
The attack occurred as Navalny was leaving his office to attend the Global Event Forum in Moscow.