The resting membrane potential is maintained by three mechanisms:
First, by selective permiability to potassium and chloride, which have Nerst potentials of -90 and -80. respectively.
Second, by the 3Na/2K ATPase pump, which exports charge and maintains the potassium gradient.
Third, by the Gibbs-Donnan effect, where impermiate intracellular anions generate a charge difference.
If there is a membrane, permeable only to one ion, then the voltage across the membrane is given by the Nernst potential for that ion.
$$\Delta V = \frac{RT}{zF}\ln\frac{[Ion]_{\text{out}}}{[Ion]_{\text{in}}}$$
where R is the gas constant, T is the absolute temperature, z is the ion valence, and F is the Faraday constant. \(\frac{RT}{F} = 26.7\text{mV}\).
This gives a good way to understand the opening of an ion channel - it "drags the membrane voltage towards the Nernst potential for that ion".
This is an extension of the Nerst equations to account for multiple ions:
$$\Delta V = \frac{\sum_{\text{Cations C}} P_C[C]_out + \sum_{text{Anions A}} P_A}[A]_in}{\sum_{\text{Cations C}} P_C[C]_in + \sum_{text{Anions A}} P_A}[A]_out}$$
When the permiability of all but one ion is set to zero, this reduces to the Nerst equation.
This occurs when there is an impermiable ion on one side of a semipermiable membrane. Consider the case of anionic protein inside a cell, with a membrane permiable to chloride.
This effect also amplifies the oncotic pressure exerted by plasma proteins, with exert a Gibbs-Donnan influence by dragging extra cations into the plasma (in addition to what would be expected from their charge).