Effects of the close approach of potential curves in photoabsorption by diatomic molecules. I: Theory and computational procedures