Commensurate-incommensurate transitions in rare-gas monolayers adsorbed on graphite and in layered charge-density-wave systems