Chemical structure of circumstellar shells