Purana Jyotisha Sangraha · by Vyasa
Chapter 13 · Kashi: Planet and Nakshatra Lingas
स्कन्दपुराणम् : काश्यां ग्रहनक्षत्रलिङ्गानि लोलार्कश्च
उमया सहितं रुद्रं संतर्प्याध्वरकर्मणा ।प्राप सोम इति ख्यातिं दत्तां सोमेन शंभुना ॥ ३४ ॥
From the Skanda Purana, print Kashi Khanda (Purvardha) ch 14, verse 34.
By the sacrifice he pleased Rudra along with Uma. He gained the name Soma, given by Shambhu, who is himself Soma.
Simple meaning: The Moon pleased Shiva and gained the name Soma from him.
तत्रैव तप्तवान् सोमस्तपः परमदुष्करम् ।
The Moon did hard austerity and the Rajasuya in front of Chandreshvara.
तत्रैव ब्राह्मणैः प्रीतैरित्युक्तोसौ कलानिधिः ।
Pleased Brahmins called the Moon their king.
तत्रैव देवदेवस्य विलोचनपदं गतः ।
The Moon reached Shiva's eye, and Shiva spoke for the joy of the worlds.