1-5 dicarboxylic acid to lactone with SOCl2? I came across a reaction whereby a 1-5 dicarboxylic acid is converted to lactone with $\ce{SOCl2}$. I was wondering what the mechanism of this was.

I know that $\ce{SOCl2}$ converts carboxylic acids to acyl chlorides. Is it the case that one carboxylic acid undergoes this transformation, then the oxygen from the $\ce{OH}$ of the other carboxylic acid attacks the acyl chloride, making the $\ce{Cl}$ a leaving group? 

Is this the case or am I missing something?
The simplest 1,5-dicarboxylic acid is glutaric acid (pentanedioic acid in a more systematical naming). If you react it with $\ce{SOCl2}$, you will indeed intermediately arrive at a compound that has one carboxylic group and one acid chloride group. Then, as you suggest, the other carboxylic acid can attack the acid chloride and $\ce{HCl}$ is eleminated.

However, the resulting product is not a lactone but rather glutaric anhydride; a cyclic acid anhydride. To convert it to a lactone you would need to remove exactly one carbonyl group. Whether this is done before or after the reaction with $\ce{SOCl2}$ does not matter, but before sounds easier to me.