Thermal Casimir force and nernst theorem for a small particle interacting with a surface