Connect XY Co-ordinates with a line

Any of you guys know how to take two X & Y co-ords (for example, of two objects) - and then spawn a line object which rotates and positions itself as to connect each object (for example, two beach balls tied together with string) ? Any help would be appreciated.
Comments
Hope this helps!
Joe