(Reuters) - Applied Materials Inc will buy rival Tokyo Electron Ltd in an all-stock deal valued at more than $9 billion, combining the No.1 and No.3 makers of chip-making gear as demand for their products slows and it gets tougher to turn a profit.