Long-chain hydrocarbon anions CnH- (n=4, 6, 8) have recently been found to be
abundant in a variety of interstellar clouds. In order to explain their large
abundances in the denser (prestellar/protostellar) environments, new chemical
models are constructed that include gas-grain interactions. Models including
accretion of gas-phase species onto dust grains and cosmic-ray-induced
desorption of atoms are able to reproduce the observed anion-to-neutral ratios,
as well as the absolute abundances of anionic and neutral carbon chains, with a
reasonable degree of accuracy. Due to their destructive effects, the depletion
of oxygen atoms onto dust results in substantially greater polyyne and anion
abundances in high-density gas (with n_{H_2} >~ 10^5 cm^{-3}). The large
abundances of carbon-chain-bearing species observed in the envelopes of
protostars such as L1527 can thus be explained without the need for warm
carbon-chain chemistry. The C6H- anion-to-neutral ratio is found to be most
sensitive to the atomic O and H abundances and the electron density. Therefore,
as a core evolves, falling atomic abundances and rising electron densities are
found to result in increasing anion-to-neutral ratios. Inclusion of cosmic-ray
desorption of atoms in high-density models delays freeze-out, which results in
a more temporally-stable anion-to-neutral ratio, in better agreement with
observations. Our models include reactions between oxygen atoms and
carbon-chain anions to produce carbon-chain-oxide species C6O, C7O, HC6O and
HC7O, the abundances of which depend on the assumed branching ratios for
associative electron detachment