Weakly-shocked flows of the solar wind plasma through atmospheres of comets and planets