The physical foundation of formation lithology logging with gamma rays