Magnetohydrodynamic solution for a Z pinch showing the production of a hot spot