As I understand it the lights pointing backwards are for formation flying -- they should be visible only to aircraft just behind and avoid accidental rear ending.
Sometimes you see other narrow angle lights pointing downwards and in this case the purpose is IFF. They would be turned on over friendly territory so that people directly underneath would not shoot at you.