During the World Cup, the referees sprayed something on the ground. It looked like it was white paint, but it was foamy. It was right before a free-kick on goal.
What was the stuff they sprayed on the ground?
It's called "Vanishing foam".
It's used as an indicator by the referees to indicate the minimum distance the players must maintain from ball, in the event of a free kick, as well as the spot from where it is taken.
Technical details: The can contains water (~80%), butane gas (~17%), surfactant (~1%), and other ingredients (~2%).
Update: The foam is now authorized for use in top flight football for the Bundesliga in Germany, Serie A in Italy, Ligue 1 in France, La Liga in Spain, the Premier League in England, the Synot liga in Czech Republic, the A-League in Australia and Thai Premier League in Thailand.
Refer this wiki.
Also another link.