The purpose of this paper is to study the interaction between a two-level system (qubit) and two continuous-mode photons. Two scenarios are investigated: Case 1, how a two-level system changes the pulse shapes of two input photons propagating in a single input channel; and Case 2, how a two-level system responds to two counter-propagating photons, one in each input channel. By means of a transfer function approach, the steady-state output field states for both cases are derived analytically in both the time and frequency domains. For Case 1, two examples are presented. In Example 1 a two-photon input state of Gaussian pulse shape is used to excite a two-level atom. The joint probability distribution in the time domain and the joint spectra of the output two-photon state are plotted. The simulation demonstrates that in the time domain the atom tends to stretch out the two photons. Moreover, the prominent difference between the joint probability distribution of the output two-photon state and that of the input two-photon state occurs exactly under the setting when the two-level atom is most efficiently excited. In Example 2, a two-photon input state of rising exponential pulse shape is used to excite a two-level atom. Strong anti-correlation of the output two-photon state is observed, which is absent in Example 1 for the Gaussian pulse shape. Such difference indicates that different pulse shapes give rise to drastically different frequency entanglement of the output two-photon state. Example 3 is used to illustrate Case 2, where two counter-propagating single photons of rising exponential pulse shapes are input to a two-level atom. The frequency-dependent Hong-Ou-Mandel (HOM) interference phenomenon is observed. Moreover, when the two output photons are in the same channel, they are anti-correlated. The simulation results base on the analytic forms of output twophoton states are consistent with those based on quantum master or filter equations [43], [11]. Similar physical phenomena have been observed in physical settings such as cavity opto-mechanical systems and Keer nonlinear cavities.