How did a star point to Bethlehem?

Stars are extremely large and extremely hot, and would seem ill-suited for identifying small towns.