From The Two Towers, Book 3, Chapter 2, The Riders of Rohan:
Suddenly Gimli looked up, and there just on the edge of the firelight stood an old bent man, leaning on a staff, and wrapped in a great cloak; his wide-brimmed hat was pulled over his eyes...[Aragorn] strode forward, but the old man was gone. There was no trace of him to be found near at hand, and they did not dare to wander far.
Later on we have (Chapter 5, The White Rider):
'Wait a minute!' cried Gimli. 'There is another thing that I should like to know first. Was it you, Gandalf, or Saruman that we saw last night?'
'You certainly did not see me,' answered Gandalf, 'therefore I must guess that you saw Saruman. Evidently we look so much alike that your desire to make an incurable dent in my hat must be excused.'
But if it was indeed Saruman, why did he simply observe the three companions and then disappear? Gandalf says to Gimli in Chapter 10, The Voice of Saruman:
'I will come,' said Gimli. 'I wish to see him and learn if he really looks like you.'
'And how will you learn that, Master Dwarf?' said Gandalf. 'Saruman could look like me in your eyes, if it suited his purpose with you.'
So why did not Saruman question the three if it really was him? At that point in the story he was surely in need of knowledge of the orc host and their captives.
Throughout the book Frodo has visions of things happening (or about to, or have done), so could this have instead been a vision of Gandalf they saw, as a premonition of his return?
Is there anything explaining or shedding more light on this?