A theory of glass electrode response