One of the more famous examples of this is "Sweet Home Alabama," Lynyrd Skynyrd's 1974 response to Neil Young's earlier songs slamming stereotypical Southern racism, "Southern Man" and "Alabama." Neil apparently loved it when he heard his name in the track, as the bands were friendly:
"Well I heard Mr Young sing about it
Well I heard old Neil put her down
Well I hope Neil Young will remember
Southern Man don't need him around anyhow..."
Apparently Neil Young is extremely inspiring, because the other song that springs to mind as being written in response to a great song is Joni Mitchell's "The Circle Game," which she wrote for Neil after hearing his "Sugar Mountain." Both songs are about growing older and youth slipping by. The two songwriters met back in 1964, the same year 19 year old Neil wrote "Sugar Mountain," which contains the line "You can't be 20/on Sugar Mountain." Joni's response in "The Circle Game": "So the years spin by and now the boy is twenty/ Though his dreams have lost some grandeur coming true/There'll be new dreams, maybe better dreams and plenty/Before the last revolving year is through."