As seen in the linked video, released by the ACLU of Virginia, the order of events was:
First Corey Long directs paint spray toward a group of protestors carrying confederate flags, who are on the stairs. The protestor (Scott Woods) furthest down the stairs briefly covers his mouth with his shirt to avoid inhaling the spray.
[These stairs are the south-west exit from Emancipation Park, formerly Lee Park, onto Market Street]
Next Corey Long ignites the spray.
Then Scott Woods waves the flag pole at the flame.
Then a third person in the street points a handgun in the general direction of Long and fires, at the ground according the New York Times article linked above.
Richard Wilson Preston has been arrested for allegedly discharging a firearm within 1000 feet of a school in connection with the shooting. (seeVirginia § 18.2-280) Additional information about Preston was reported by the Baltimore Sun.
At a 12 October 2017 hearing, Judge Robert H. Downer denied Preston bond and said:
I think firing a firearm under those circumstances is not justified ... It may justify pulling a pistol out — and maybe when I see the video I may change my mind — but a bullet goes somewhere, and this was in a park where there were lots of people.
Update 16 October 2017:
Corey Alexander Long (the man with the flamethrower) has been charged with assault and with disorderly conduct in connection with the incident according to Charlottesville District Court records and news reports .
Update 14 June 2018:
Richard Wilson Preston pleaded "no contest" to the charges and will be sentenced 21 August 2018. In a second video of the incident shown in court, Preston said to the flamethrower man, "Go ahead, I'll shoot you. Go ahead.", according to NBC News.
Corey Alexander Long was found guilty of disorderly conduct, but charges of assault were not prosecuted. Long was sentenced to 360 days, all but 20 days of which were suspended.