Active barrier coating for solar cells