Greene King has bought a rival UK pub chain.