Divine Divinity is the first game, and is generally considered to be better. There are some things I liked more about Beyond Divinity, but if you have to choose between them, Divine Divinity is the one to get.
You may be able to find the disk version of both games online (eBay, etc), or you can get the download versions from GOG (or Impulse). The download version of Divine Divinity adds support for widescreen and higher resolutions than the disk version supported, as well as a few relatively minor changes and bug fixes. The download and disk versions of Beyond Divinity are the same.