Hi Lawrence,
The phrase "Just then" is used to describe something that occurred unexpectedly in the past or just in time (also in the past). In summary, it is used to describe something that happened when you least expected it.
Examples:
I was looking at the arrival time for the express train. Just then, it pulled into the station.
The rival gang members were engaged in a fist fight. Just then, the siren of the police cars reveberated in the air.
Hope this helps.
Cheers,
Lance