The Valeyard

The Valeyard was an entity created "somewhere between the Doctor's twelfth and final incarnations", perhaps the essence of the Doctor's negative emotion from that time.The doctor was his most unpleasant sight on that single few episodes even the sixth doctor never realised thats who he was going to be in the future.

First meeting with the Doctor
Other than a cryptic hint, the origins of the Valeyard are unknown. According to the Master, the Valeyard was the personification of all that was evil within the Doctor, estimated to have been taken from somewhere between his twelfth and final incarnations. (DW: The Ultimate Foe)

The Valeyard served as the prosecutor during the trial of the Doctor. He presented extracts from the Matrix, depicting past events in the Doctor's life as evidence of the Doctor violating the Time Lords' non-interference policy. (DW: The Mysterious Planet, DW: Mindwarp) Later in the trial, the Valeyard added a charge of genocide against the Vervoids. (DW: Terror of the Vervoids)

The Valeyard had secretly tampered with the Matrix extracts to show the Doctor in the worst possible light and steer the trial to a guilty verdict. The Valeyard was acting on behalf of the High Council to cover up the Ravolox affair. As payment, the Valeyard was to have received the Doctor's remaining regenerations. However, the Master eventually stepped in and revealed the Valeyard's true motives. (DW: The Ultimate Foe)

The Valeyard escaped into the Matrix via the Seventh Door, which he opened using a copy of the Key of Rassilon. He was pursued and finally defeated by the actions of the Doctor's sixth incarnation of feeding the effect of an explosion, intended by the Valeyard to destroy the court, back into the Matrix. The Inquisitor subsequently dismissed the trial.

However, as the Doctor and his companion Melanie Bush departed, the Valeyard was secretly still present, disguised as the Keeper of the Matrix. (DW: The Ultimate Foe)

Return
The Valeyard returned and tangled with the Doctor in his seventh incarnation, revealing now his mastery of the Dark Matrix, a counterpart of the normal Matrix. During this time he assumed the identity of Jack the Ripper, using the Ripper murders to 'feed' the Matrix as he attempted to use its power to give himself a true body, simultaneously reaching out into his past to corrupt the Doctor's other selves to do his work. Fortunately, the Seventh Doctor escaped the Valeyard's influence by sealing his conscious mind in the TARDIS's telepathic circuits, eventually being reunited with the circuits in time to save his companion Ace from being the Ripper's sixth victim. Provoking the Matrix into rebelling against the Valeyard's control of it, the Doctor and the Valeyard- now calling himself the Ripper- clashed on top of the church where the Valeyard had hidden his TARDIS, until the destruction of the TARDIS and the Dark Matrix released a burst of energy that struck and killed the Ripper. (PDA: Matrix)

Other timelines
In one timeline, the Valeyard defeated the Doctor and went on to wreak havoc throughout time and space, twisting reality and changing his own history as he claimed control of the various doomsday weapons that the Doctor had 'foolishly' left behind or destroyed. When last seen, this Valeyard had sealed himself away inside his own TARDIS, imprisoning himself with various forcefields in order to keep himself immobilised, terrified to even move an inch in case he caused further damage to reality, reflecting that he had caused so much damage because he lacked the Doctor's knowledge of when to not take action. (DWU: He Jests at Scars...)

False Valeyards
When the Doctor found himself in an alternate version of London created by Ashley Chapel's use of the Millennium Codex, he began to manifest magical powers in keeping with the new unstable universe's laws of physics. However, using these powers began to transform him into the Valeyard. This was not the actual Valeyard, but a manifestation of the Doctor's worst fears. (MA: Millennial Rites)

Years later, a creature called the Es'Cartress of the Tactire assumed the form of the meta-crisis Doctor, in order to steal the Doctor's memories. Prior to revealing his true identity, the Es'Cartess suggested to the Doctor that he was in fact the Valeyard. The Doctor dismissed this suggestion, leading to the revelation of the Es'Cartess's identity. (IDW: The Forgotten)

Personality
In certain aspects, the Valeyard was similar to several of the Doctor's incarnations, quite cunning and verbal, with a knack for manipulation. He had a bit of a temper, and was prone to outbursts, but generally calm and collected, a trait numerous incarnations of the Doctor exhibited. However, his actions were constantly defined by his focus on himself, with the Valeyard willing to risk or sacrifice anything if it meant ensuring his own existence, as seen in his willingness to break the Laws of Time and kill his own past self and his attempt to control the Dark Matrix despite the dangers its presence would pose to established history.

In an alternate timeline where he defeated the Doctor, he reflected that his most obvious difference from the Doctor was that he, unlike the Doctor, did not know when to stop, continually manipulating the universe to achieve his desired outcome where the Doctor was able to recognise that sometimes the best thing to do was to not take action.

Behind the scenes

 * Some of the intended background behind the Valeyard was lost due to creative differences between John Nathan-Turner, Doctor Who's producer at the time, and script editor Eric Saward. An earlier draft of The Ultimate Foe had made it clear that the Doctor would definitely, at some stage, turn into the Valeyard, desperate to extend his life after his remaining regenerations had run out - a situation not dissimilar to the one previously faced by the Master. Nathan-Turner did not favour the dark nature of these and other developments in the script. As a result of the disagreement, Saward, who with Robert Holmes wrote the original script for The Ultimate Foe, refused to allow any elements of it into the final product. Pip and Jane Baker ended up patching up the continuity - without reference to the scripts, for legal reasons.
 * With the events of Journey's End, some fans speculated that the meta-crisis Doctor would eventually become the Valeyard. The events of IDW: The Forgotten lent some credence to this. All of this credibility was lost, however, when this entity was revealed to be a Cranial Parasite attached to the Doctor.
 * Writer's guidelines for the Virgin New Adventures specifically asked writers not to discuss about the continuity issues created by the Valeyard or the Doctor's trial in The Trial of a Time Lord and took the official line that those events had taken place in the Doctor's personal future. Some novels, however (Love and War by Paul Cornell, among others), did not do so.
 * The Valeyard appeared in the un-authorized fan novel charity publication Time's Champion begun by Craig Hinton and completed by Chris McKeon.