To prevent you from having to experience such a similar encounter (which could turn out worse) and for your safety, here are some basic tips for biking at night, whether you are just running some errands, leaving work or going home from classes:
Lights, lights, lights – Ensure your bike is equipped with a pair of lights. Keeping your cycle well lit will help other road users on the road to see you during the night and this will help to prevent accidents or collisions. In addition, your lights will help you to see obstacles along your path on the road ways (for example, potholes).
Reflectors – The bare minimum I recommend is having reflectors between your bicycle spokes on the wheel with front and rear reflectors (one on the handle bar and one below the seat pole). Like your lights, reflectors help other road users to see you coming. When a motor vehicle´s light hits your reflector, it reflects or lights up in a way that they cannot miss you, thus further ensuring your safety at night.
Clothing – Whilst riding at night, it is a good idea to not be wearing black clothes or dark colored clothing. Wear something bright, preferably white at all times as this will also help other road users to see you in the dark. This is a general rule that not only applies to cyclists but also is advised to pedestrians on the roadways at night.
Be alert and vigilant – The most important thing you can do, in my opinion, is to be vigilant and on the lookout whilst riding at night. Be on the lookout for pedestrians who may wander on the roadways and also for motor vehicles. I would further advise that you choose safe routes for biking after dark because you may be taking all the necessary precautions but there will always be reckless drivers on the road. Also, do not ride in places that are known to be dangerous at night or places that are too lonely. If possible, find a friend to go biking with at night.