I've been reading sites, and I know that it's possible to buy tickets to visit Taj Mahal in advance online, but is it possible to buy tickets at the spot - in Agra (using cash)?
Yes, it's possible to buy tickets on the spot. As official website of Taj Mahal show outlets from which you can buy tickets.
Ticket Outlets (Buying a Taj Mahal Ticket From Entry Gate Ticket Counter)
Taj Mahal Western Gate :- Tickets are available on Western Gate near Saheli Burj. (Timing-from Sunrise to Sunset).
Taj Mahal Eastern Gate :- Tickets are available at Shilpgram (about 750 meters from Eastern Gate of Taj Mahal. (Timing-from Sunrise to Sunset).
Taj Mahal Southern Gate :- Tickets are available on Southern Gate. (Timing - 8:00 A.M. To 5:00 P.M.)
Tickets may be purchased at all three Taj Mahal entry gates. There are separate queues for Foreign tourists and Domestic tourists and signs will direct you accordingly.