Overlay for target information

How can I create an overlay with the information about far away enemies position? I would like to put a red square around each enemy spaceship, so they are visible even when they are too far away to be noticeable

There are various ways it could be done. Here's one way: compute the screen space position of each ship using Camera.WorldToScreenPoint(), and then render GUI elements in screen space at the appropriate locations. (You might need to make some adjustments to make sure the UI elements are the same size regardless of resolution. For more info on this, search Unity Answers or the forums for 'resolution-independent gui'.)