Dora Bas Rivka Silver O'H
If a Jew becomes so impoverished that he must sell himself to a person from another nation, there is an obligation to redeem him. The obligation first falls on the person's family. (In fact, if a relative has the means to redeem him but doesn't want to, the courts can compel him to do so. See Mishneh Torah, Hilchos Avadim 2:7.) They must calculate the redemption price with the purchaser based upon time served and time remaining until the Jubilee. (This refers to a Jew purchased by a non-Jew living in Israel, so he would still be released by the Jubilee.) Furthermore, one may not permit a master to abuse a slave if within one's ability to prevent it.
G-d commands all these laws to protect slaves because the Jews are really His servants. Therefore, they'd better not worship idols! They may not even bow down to Him on a stone floor. (This was a form of worship exclusive to the Temple – see Talmud Megilla 22b.)
G-d closes the parsha with a reminder to be careful about Shabbos and to safeguard the holiness of the Temple/Tabernacle.