Name of the book is The Doctor and the Kid: A Weird West Tale.
I don't like these books (this is the second in this series) as well as his other fantasy and SF work. Reading the books reminds me very much of his Widowmaker series, which should be no surprise since they deal with a gunslinger in the frontier of galactic exploration. I guess the point is that it's essentially a form of steampunk, but that genre isn't my favorite. Still, I did enjoy it well enough to want to see more, and it appears there will be more books coming.