Most halogens form compounds by