You use this when you are very surprised. It shows you did not expect something. It can be good or bad surprise.
、。
I can't believe that he quit the company without saying anything.
まさか、。
To think that I would get first place... I never even dreamed of it.
、?
To think you don't even know something this simple... are you really okay?
、。
To think you completed this painting all by yourself is a sign of wonderful talent.
、。
For that honest guy to tell a lie, there must be some special reason.